{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# XGBoost Regression from Scratch\n",
    "\n",
    "The Gradient Boosting (GB) algorithm trains a series of weak learners and each focuses on the errors the previous learners have made and tries to improve it. Together, they make a better prediction.\n",
    "\n",
    "According to Wikipedia, Gradient boosting is a machine learning technique for regression and classification problems, which produces a prediction model in the form of an ensemble of weak prediction models, typically decision trees. It builds the model in a stage-wise fashion as other boosting methods do, and it generalizes them by allowing optimization of an arbitrary differentiable loss function. \n",
    "\n",
    "Prerequisite\n",
    "\n",
    "    1. Linear regression and gradient descent\n",
    "    2. Decision Tree\n",
    "\n",
    "After studying this post, you will be able to:\n",
    "\n",
    "    1. Explain gradient boosting algorithm.\n",
    "    2. Explain gradient boosting regression algorithm.\n",
    "    3. Write a gradient boosting regressor from scratch\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "    \n",
    "# The algorithm\n",
    "\n",
    "The following plot illustrates the algorithm.\n",
    "\n",
    "![Gradient Boosting Regression](gradient_boosting/gradient_boosting_regression.png)\n",
    "\n",
    "From the plot above, the first part is a stump, which is the average of **y**. We then add several trees to it. In the following trees, the target is not y. Instead, the target is the residual or the true value subtracts the previous prediction.\n",
    "\n",
    "$$residual=true\\_value - previous\\_prediction$$\n",
    "\n",
    "That is why we say in Gradient Boosting trains a series of weak learners, each focuses on the errors of the previous one. The residual predictions are multiplied by the learning rate (0.1 here) before added to the average.\n",
    "\n",
    "---\n",
    "\n",
    "**The Steps**\n",
    "\n",
    "Step 1: Calculate the average of y. The average is also the first estimation of y:\n",
    "$$F_0=0.5$$\n",
    "\n",
    "Step 2 for m in 1 to M: <br />\n",
    "  * Step 2.1: Compute so-call pseudo-residuals:\n",
    "    $$r_{im}=y_i-F_{m-1}(x_i)$$\n",
    "  * Step 2.2: Fit a regression tree $t_m(x)$ to pseudo-residuals and create terminal regions (leafs) $R_{jm}$ for $j=1...Jm$ <br />\n",
    "\n",
    "  * Step 2.3: For each leaf of the tree, there are $p_j$ elements, compute $\\gamma$ as following equation. <br />\n",
    "\n",
    "$$\\gamma_{im}=\\frac{1}{p_j} \\sum_{x_i \\in R_{jm}} r_{im}$$\n",
    "\n",
    "  * (In practise, the regression tree will do this for us.)\n",
    "\n",
    "  * Step 2.4: Update the model with learning rate $\\alpha$:\n",
    "$$F_m(x)=F_{m-1}+\\alpha\\gamma_m$$\n",
    "\n",
    "\n",
    "Step 3. Output $$F_M(x)$$\n",
    "\n",
    "---\n",
    "\n",
    "In practice the regression tree will average the leaf for us. Thus, Step 2.2 and 2.3 can be combined into one step. And the steps can be simplified:\n",
    "\n",
    "---\n",
    "\n",
    "**New The Steps**\n",
    "\n",
    "Step 1: Calculate the average of y. The average is also the first estimation of y:\n",
    "$$\\bar{y}=\\frac{1}{n} \\sum_{i=1}^{n}y_i$$\n",
    "\n",
    "$$F_0(x)=\\bar{y}$$\n",
    "Step 2 for m in 1 to M: <br />\n",
    "  * Step 2.1: Compute so-call pseudo-residuals:\n",
    "    $$r_{im}=y_i-F_{m-1}(x_i)$$\n",
    "  * Step 2.2: Fit a regression tree $t_m(x)$ to pseudo-residuals\n",
    "\n",
    "  * Step 2.3: Update the model with learning rate $\\alpha$:\n",
    "$$F_m(x)=F_{m-1}+\\alpha t_m(x)$$\n",
    "\n",
    "\n",
    "Step 3. Output $$F_M(x)$$\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# (Optional) From XGBoost to XGBoost Regression\n",
    "\n",
    "The above knowledge is enough for writing BGR code from scratch. But I want to explain more about gradient boosting. GB is a meta-algorithm that can be applied to both regression and classification. The above one is only a specific form for regression. In the following, I will introduce the general gradient boosting algorithm and deduce GBR from GB.\n",
    "\n",
    "Let's first look at the GB steps\n",
    "\n",
    "---\n",
    "\n",
    "**The Steps**\n",
    "\n",
    "Input: training set $\\{(x_i, y_i)\\}_{i=1}^{n}$, a differentiable loss function $L(y, F(x))$, number of iterations M\n",
    "\n",
    "Algorithm:\n",
    "\n",
    "Step 1: Initialize model with a constant value:\n",
    "\n",
    "$$F_0(x)=0.5$$\n",
    "\n",
    "Step 2 for m in 1 to M: <br />\n",
    "  * Step 2.1: Compute so-call pseudo-residuals:\n",
    "    $$r_{im}=-[\\frac{\\partial L(y_i, F(x_i))}{\\partial F(x_i)}]_{F(x)=F_{m-1}(x)}$$\n",
    "  * Step 2.2: Fit a weak learner $h_m(x)$ to pseudo-residuals. and create terminal regions $R_{jm}$, for $j=1...J_m$<br />\n",
    "\n",
    "  * Step 2.3: For each leaf of the tree, compute $\\gamma$ as the following equation. Here $\\hat{r}$ is the predicted residual produced by $h_m(x)$.<br />\n",
    "$$\\gamma_{jm}=\\underset{\\gamma}{\\operatorname{argmin}}\\sum_{x_i \\in R_{jm}}^{n}L(y_i, F_{m-1}(x_i)+\\gamma)$$\n",
    "\n",
    "  * Step 2.4: Update the model with learning rate $\\alpha$:\n",
    "$$F_m(x)=F_{m-1}+\\alpha\\gamma_m$$\n",
    "\n",
    "\n",
    "Step 3. Output $$F_M(x)$$\n",
    "\n",
    "---\n",
    "\n",
    "To deduce the GB to GBR, I simply define a loss function and solve the loss function in step 1, 2.1 and 2.3. We use sum of squared errror(SSE) as the loss function:\n",
    "\n",
    "$$L(y, \\gamma)=\\frac{1}{2}\\sum_{i=1}^{n}(y_i-\\gamma)^2$$\n",
    "\n",
    "\n",
    "\n",
    "For step 1:\n",
    "\n",
    "\n",
    "$$F_0=0.5$$\n",
    "\n",
    "For step 2.1:\n",
    "\n",
    "$$r_{im}=-[\\frac{\\partial L(y_i, F(x_i))}{\\partial F(x_i)}]_{F(x)=F_{m-1}(x)}$$\n",
    "\n",
    "$$=-[\\frac{\\partial \\frac{1}{2}\\sum_{i=1}^{n}(y_i-F_{m-1}(x_i))^2)}{\\partial F_{m-1}(x_i)}]_{F(x)=F_{m-1}(x)}$$\n",
    "\n",
    "(The chain rule)\n",
    "\n",
    "$$=--2*\\frac{1}{2}(y_i-F_{m-1}(x_i))$$\n",
    "$$=y_i-F_{m-1}(x_i)$$\n",
    "\n",
    "For step 2.3:\n",
    "\n",
    "Similarly, the result is:\n",
    "\n",
    "$$\\gamma_{jm}=\\frac{1}{p_j}\\sum_{x_i \\in R_j}r_{mi}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.datasets import load_boston\n",
    "from sklearn.model_selection import train_test_split\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import graphviz \n",
    "from sklearn import tree"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Load data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".. _boston_dataset:\n",
      "\n",
      "Boston house prices dataset\n",
      "---------------------------\n",
      "\n",
      "**Data Set Characteristics:**  \n",
      "\n",
      "    :Number of Instances: 506 \n",
      "\n",
      "    :Number of Attributes: 13 numeric/categorical predictive. Median Value (attribute 14) is usually the target.\n",
      "\n",
      "    :Attribute Information (in order):\n",
      "        - CRIM     per capita crime rate by town\n",
      "        - ZN       proportion of residential land zoned for lots over 25,000 sq.ft.\n",
      "        - INDUS    proportion of non-retail business acres per town\n",
      "        - CHAS     Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)\n",
      "        - NOX      nitric oxides concentration (parts per 10 million)\n",
      "        - RM       average number of rooms per dwelling\n",
      "        - AGE      proportion of owner-occupied units built prior to 1940\n",
      "        - DIS      weighted distances to five Boston employment centres\n",
      "        - RAD      index of accessibility to radial highways\n",
      "        - TAX      full-value property-tax rate per $10,000\n",
      "        - PTRATIO  pupil-teacher ratio by town\n",
      "        - B        1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town\n",
      "        - LSTAT    % lower status of the population\n",
      "        - MEDV     Median value of owner-occupied homes in $1000's\n",
      "\n",
      "    :Missing Attribute Values: None\n",
      "\n",
      "    :Creator: Harrison, D. and Rubinfeld, D.L.\n",
      "\n",
      "This is a copy of UCI ML housing dataset.\n",
      "https://archive.ics.uci.edu/ml/machine-learning-databases/housing/\n",
      "\n",
      "\n",
      "This dataset was taken from the StatLib library which is maintained at Carnegie Mellon University.\n",
      "\n",
      "The Boston house-price data of Harrison, D. and Rubinfeld, D.L. 'Hedonic\n",
      "prices and the demand for clean air', J. Environ. Economics & Management,\n",
      "vol.5, 81-102, 1978.   Used in Belsley, Kuh & Welsch, 'Regression diagnostics\n",
      "...', Wiley, 1980.   N.B. Various transformations are used in the table on\n",
      "pages 244-261 of the latter.\n",
      "\n",
      "The Boston house-price data has been used in many machine learning papers that address regression\n",
      "problems.   \n",
      "     \n",
      ".. topic:: References\n",
      "\n",
      "   - Belsley, Kuh & Welsch, 'Regression diagnostics: Identifying Influential Data and Sources of Collinearity', Wiley, 1980. 244-261.\n",
      "   - Quinlan,R. (1993). Combining Instance-Based and Model-Based Learning. In Proceedings on the Tenth International Conference of Machine Learning, 236-243, University of Massachusetts, Amherst. Morgan Kaufmann.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>CRIM</th>\n",
       "      <th>ZN</th>\n",
       "      <th>INDUS</th>\n",
       "      <th>CHAS</th>\n",
       "      <th>NOX</th>\n",
       "      <th>RM</th>\n",
       "      <th>AGE</th>\n",
       "      <th>DIS</th>\n",
       "      <th>RAD</th>\n",
       "      <th>TAX</th>\n",
       "      <th>PTRATIO</th>\n",
       "      <th>B</th>\n",
       "      <th>LSTAT</th>\n",
       "      <th>ONE</th>\n",
       "      <th>PRICE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.00632</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.31</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.538</td>\n",
       "      <td>6.575</td>\n",
       "      <td>65.2</td>\n",
       "      <td>4.0900</td>\n",
       "      <td>1.0</td>\n",
       "      <td>296.0</td>\n",
       "      <td>15.3</td>\n",
       "      <td>396.90</td>\n",
       "      <td>4.98</td>\n",
       "      <td>1</td>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.02731</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>6.421</td>\n",
       "      <td>78.9</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>396.90</td>\n",
       "      <td>9.14</td>\n",
       "      <td>1</td>\n",
       "      <td>21.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.02729</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>7.185</td>\n",
       "      <td>61.1</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>392.83</td>\n",
       "      <td>4.03</td>\n",
       "      <td>1</td>\n",
       "      <td>34.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.03237</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>6.998</td>\n",
       "      <td>45.8</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>394.63</td>\n",
       "      <td>2.94</td>\n",
       "      <td>1</td>\n",
       "      <td>33.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.06905</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>7.147</td>\n",
       "      <td>54.2</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>396.90</td>\n",
       "      <td>5.33</td>\n",
       "      <td>1</td>\n",
       "      <td>36.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      CRIM    ZN INDUS CHAS    NOX     RM   AGE     DIS  RAD    TAX PTRATIO  \\\n",
       "0  0.00632  18.0  2.31  0.0  0.538  6.575  65.2  4.0900  1.0  296.0    15.3   \n",
       "1  0.02731   0.0  7.07  0.0  0.469  6.421  78.9  4.9671  2.0  242.0    17.8   \n",
       "2  0.02729   0.0  7.07  0.0  0.469  7.185  61.1  4.9671  2.0  242.0    17.8   \n",
       "3  0.03237   0.0  2.18  0.0  0.458  6.998  45.8  6.0622  3.0  222.0    18.7   \n",
       "4  0.06905   0.0  2.18  0.0  0.458  7.147  54.2  6.0622  3.0  222.0    18.7   \n",
       "\n",
       "        B LSTAT ONE PRICE  \n",
       "0  396.90  4.98   1  24.0  \n",
       "1  396.90  9.14   1  21.6  \n",
       "2  392.83  4.03   1  34.7  \n",
       "3  394.63  2.94   1  33.4  \n",
       "4  396.90  5.33   1  36.2  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "404 102 14\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>CRIM</th>\n",
       "      <th>ZN</th>\n",
       "      <th>INDUS</th>\n",
       "      <th>CHAS</th>\n",
       "      <th>NOX</th>\n",
       "      <th>RM</th>\n",
       "      <th>AGE</th>\n",
       "      <th>DIS</th>\n",
       "      <th>RAD</th>\n",
       "      <th>TAX</th>\n",
       "      <th>PTRATIO</th>\n",
       "      <th>B</th>\n",
       "      <th>LSTAT</th>\n",
       "      <th>ONE</th>\n",
       "      <th>PRICE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.00632</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.31</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.538</td>\n",
       "      <td>6.575</td>\n",
       "      <td>65.2</td>\n",
       "      <td>4.0900</td>\n",
       "      <td>1.0</td>\n",
       "      <td>296.0</td>\n",
       "      <td>15.3</td>\n",
       "      <td>396.90</td>\n",
       "      <td>4.98</td>\n",
       "      <td>1</td>\n",
       "      <td>0.159686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.02731</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>6.421</td>\n",
       "      <td>78.9</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>396.90</td>\n",
       "      <td>9.14</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.101524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.02729</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>7.185</td>\n",
       "      <td>61.1</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>392.83</td>\n",
       "      <td>4.03</td>\n",
       "      <td>1</td>\n",
       "      <td>1.324247</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.03237</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>6.998</td>\n",
       "      <td>45.8</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>394.63</td>\n",
       "      <td>2.94</td>\n",
       "      <td>1</td>\n",
       "      <td>1.182758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.06905</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>7.147</td>\n",
       "      <td>54.2</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>396.90</td>\n",
       "      <td>5.33</td>\n",
       "      <td>1</td>\n",
       "      <td>1.487503</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      CRIM    ZN INDUS CHAS    NOX     RM   AGE     DIS  RAD    TAX PTRATIO  \\\n",
       "0  0.00632  18.0  2.31  0.0  0.538  6.575  65.2  4.0900  1.0  296.0    15.3   \n",
       "1  0.02731   0.0  7.07  0.0  0.469  6.421  78.9  4.9671  2.0  242.0    17.8   \n",
       "2  0.02729   0.0  7.07  0.0  0.469  7.185  61.1  4.9671  2.0  242.0    17.8   \n",
       "3  0.03237   0.0  2.18  0.0  0.458  6.998  45.8  6.0622  3.0  222.0    18.7   \n",
       "4  0.06905   0.0  2.18  0.0  0.458  7.147  54.2  6.0622  3.0  222.0    18.7   \n",
       "\n",
       "        B LSTAT ONE     PRICE  \n",
       "0  396.90  4.98   1  0.159686  \n",
       "1  396.90  9.14   1 -0.101524  \n",
       "2  392.83  4.03   1  1.324247  \n",
       "3  394.63  2.94   1  1.182758  \n",
       "4  396.90  5.33   1  1.487503  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>CRIM</th>\n",
       "      <th>ZN</th>\n",
       "      <th>INDUS</th>\n",
       "      <th>CHAS</th>\n",
       "      <th>NOX</th>\n",
       "      <th>RM</th>\n",
       "      <th>AGE</th>\n",
       "      <th>DIS</th>\n",
       "      <th>RAD</th>\n",
       "      <th>TAX</th>\n",
       "      <th>PTRATIO</th>\n",
       "      <th>B</th>\n",
       "      <th>LSTAT</th>\n",
       "      <th>ONE</th>\n",
       "      <th>PRICE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.12579</td>\n",
       "      <td>45.0</td>\n",
       "      <td>3.44</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.437</td>\n",
       "      <td>6.556</td>\n",
       "      <td>29.1</td>\n",
       "      <td>4.5667</td>\n",
       "      <td>5.0</td>\n",
       "      <td>398.0</td>\n",
       "      <td>15.2</td>\n",
       "      <td>382.84</td>\n",
       "      <td>4.56</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.790943</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.47547</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.90</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.544</td>\n",
       "      <td>6.113</td>\n",
       "      <td>58.8</td>\n",
       "      <td>4.0019</td>\n",
       "      <td>4.0</td>\n",
       "      <td>304.0</td>\n",
       "      <td>18.4</td>\n",
       "      <td>396.23</td>\n",
       "      <td>12.73</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-0.166827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.85204</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.14</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.538</td>\n",
       "      <td>5.965</td>\n",
       "      <td>89.2</td>\n",
       "      <td>4.0123</td>\n",
       "      <td>4.0</td>\n",
       "      <td>307.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>392.53</td>\n",
       "      <td>13.83</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-0.319199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.63796</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.14</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.538</td>\n",
       "      <td>6.096</td>\n",
       "      <td>84.5</td>\n",
       "      <td>4.4619</td>\n",
       "      <td>4.0</td>\n",
       "      <td>307.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>380.02</td>\n",
       "      <td>10.26</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-0.471572</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.66998</td>\n",
       "      <td>0.0</td>\n",
       "      <td>18.10</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.631</td>\n",
       "      <td>6.683</td>\n",
       "      <td>96.8</td>\n",
       "      <td>1.3567</td>\n",
       "      <td>24.0</td>\n",
       "      <td>666.0</td>\n",
       "      <td>20.2</td>\n",
       "      <td>375.33</td>\n",
       "      <td>3.73</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.989460</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      CRIM    ZN  INDUS CHAS    NOX     RM   AGE     DIS   RAD    TAX PTRATIO  \\\n",
       "0  0.12579  45.0   3.44  0.0  0.437  6.556  29.1  4.5667   5.0  398.0    15.2   \n",
       "1  0.47547   0.0   9.90  0.0  0.544  6.113  58.8  4.0019   4.0  304.0    18.4   \n",
       "2  0.85204   0.0   8.14  0.0  0.538  5.965  89.2  4.0123   4.0  307.0    21.0   \n",
       "3  0.63796   0.0   8.14  0.0  0.538  6.096  84.5  4.4619   4.0  307.0    21.0   \n",
       "4  5.66998   0.0  18.10  1.0  0.631  6.683  96.8  1.3567  24.0  666.0    20.2   \n",
       "\n",
       "        B  LSTAT  ONE     PRICE  \n",
       "0  382.84   4.56  1.0  0.790943  \n",
       "1  396.23  12.73  1.0 -0.166827  \n",
       "2  392.53  13.83  1.0 -0.319199  \n",
       "3  380.02  10.26  1.0 -0.471572  \n",
       "4  375.33   3.73  1.0  2.989460  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boston_dict=load_boston()\n",
    "data = boston_dict['data']\n",
    "target = boston_dict['target']\n",
    "feature_names = boston_dict['feature_names']\n",
    "info = boston_dict['DESCR']\n",
    "print(info)\n",
    "df = pd.DataFrame(data=data, columns=[feature_names])\n",
    "df['ONE'] = 1\n",
    "df['PRICE'] = np.array(target) \n",
    "display(df.head())\n",
    "#display(df['ONE'])\n",
    "\n",
    "X = df[feature_names].copy()\n",
    "X['ONE'] = 1\n",
    "X = X.values\n",
    "#X = X/X.max(axis=0)\n",
    "\n",
    "\n",
    "y=target\n",
    "std=y.std()\n",
    "\n",
    "y_max=max(y)\n",
    "y_min=min(y)\n",
    "y_mean=y.mean()\n",
    "\n",
    "y=(y-y_mean)/std\n",
    "\n",
    "#y=y/std\n",
    "\n",
    "y=np.array(y)\n",
    "\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, train_size = 0.8, random_state = 11)\n",
    "\n",
    "n_train=X_train.shape[0]\n",
    "n_test=X_test.shape[0]\n",
    "m=X_train.shape[1]\n",
    "print(n_train, n_test, m)\n",
    "del df['PRICE']\n",
    "df['PRICE'] = np.array(y)\n",
    "display(df.head(5))\n",
    "feature_names_one=list(feature_names) + [\"ONE\"]\n",
    "df_train=pd.DataFrame(data=X_train, columns=[feature_names_one])\n",
    "df_train['PRICE'] = y_train\n",
    "\n",
    "display(df_train.head())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# XGB Tree"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "class SplitResult():\n",
    "    similarity=0\n",
    "    similarity_gain=0\n",
    "    i_feature=-1\n",
    "    split_value=None\n",
    "    split_quantile=0\n",
    "    # left\n",
    "    left_X=None\n",
    "    left_y=None\n",
    "    left_similarity=0\n",
    "    left_n=0\n",
    "    # right\n",
    "    right_X=None\n",
    "    right_y=None\n",
    "    right_similarity=0\n",
    "    right_n=0\n",
    "    \n",
    "class Branch:\n",
    "    no=0\n",
    "    depth=1\n",
    "    i_feature=-1\n",
    "    split_value=0\n",
    "    split_quantile=0\n",
    "    similarity=0\n",
    "    similarity_gain=0\n",
    "    n_samples=0\n",
    "    value=[]\n",
    "    X=None\n",
    "    y=None\n",
    "    \n",
    "    \n",
    "    left_branch=None\n",
    "    right_branch=None\n",
    "    \n",
    "    def value(self, _lambda):\n",
    "        \n",
    "        return np.sum(self.y)/(len(self.y)+_lambda)\n",
    "\n",
    "    \n",
    "    def is_leaf(self):\n",
    "        return self.left_branch is None and self.right_branch is None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import r2_score\n",
    "class XGBTree():\n",
    "    \n",
    "    _lambda=1\n",
    "    node_number=0\n",
    "    the_tree=None\n",
    "    max_depth=3\n",
    "    gamma=2\n",
    "    colsample_bynode=1.0\n",
    "    \n",
    "    def __init__(self, max_depth=3, _lambda=1, gamma=2, colsample_bynode=1.0):\n",
    "        \n",
    "        self.max_depth = max_depth\n",
    "        self._lambda =_lambda\n",
    "        self.gamma = gamma\n",
    "        self.colsample_bynode = colsample_bynode\n",
    "\n",
    "    def get_similarity(self, a):\n",
    "        a=np.array(a)\n",
    "        n=len(a)\n",
    "        #print(a)\n",
    "        sim=a.sum()**2/(n+self._lambda)\n",
    "\n",
    "        return sim\n",
    "    \n",
    "    def get_colsample_bynode_indics(self, n_features):\n",
    "        if n_features==1:\n",
    "            return [1]\n",
    "\n",
    "        if self.colsample_bynode>1:\n",
    "            raise ValueError(\"colsample_bynode must be smaller than or equal to 1.0\")\n",
    "\n",
    "        n_selected_features=int(self.colsample_bynode * n_features)\n",
    "        if n_selected_features==n_features:\n",
    "            return list(range(n_features))\n",
    "\n",
    "\n",
    "        old_list=list(range(n_features))\n",
    "        new_list=[]\n",
    "        for i in range(n_selected_features):\n",
    "            selected = random.choice(old_list)\n",
    "            while selected in new_list:\n",
    "                selected = random.choice(old_list)\n",
    "            new_list.append(selected)\n",
    "        return new_list\n",
    "    \n",
    "    def find_best_split(self, X, y):\n",
    "        n_features=X.shape[1]\n",
    "        best_sr=SplitResult()\n",
    "        # colsample_bynode\n",
    "        selected_features = self.get_colsample_bynode_indics(n_features)\n",
    "        for i_feature in selected_features:\n",
    "            f=X[:,i_feature]\n",
    "            # Approximate Algorithm \n",
    "            # Instead of Basic Exact Greedy Algorithm\n",
    "            quantiles = np.quantile(f, [.25,.5,.75]) \n",
    "            for split_valie, split_quantile in zip(quantiles, [.25,.5,.75]):\n",
    "                sr = SplitResult()\n",
    "                sr.i_feature=i_feature\n",
    "                condition = f<split_valie\n",
    "                #print(condition)\n",
    "                # left\n",
    "                sr.left_y = y[condition]\n",
    "                sr.left_n = len(sr.left_y)\n",
    "                if sr.left_n == 0:\n",
    "                    continue\n",
    "                sr.left_similarity = self.get_similarity(sr.left_y)\n",
    "\n",
    "                # right\n",
    "                sr.right_y = y[~condition]\n",
    "                sr.right_n = len(sr.right_y)\n",
    "                if sr.right_n == 0:\n",
    "                    continue\n",
    "                sr.right_similarity = self.get_similarity(sr.right_y)\n",
    "\n",
    "                sr.similarity = sr.left_similarity + sr.right_similarity\n",
    "                #sr.print_me()\n",
    "                if sr.similarity>best_sr.similarity:\n",
    "                    best_sr=sr\n",
    "                    best_sr.left_X = X[condition,:]\n",
    "                    best_sr.right_X = X[~condition,:]\n",
    "                    best_sr.split_value = split_valie\n",
    "                    best_sr.split_quantile = split_quantile\n",
    "        return best_sr\n",
    "    \n",
    "\n",
    "    def fit_inner(self, X, y, depth, branch_similarity):\n",
    "        branch = Branch()\n",
    "        branch.no=self.node_number\n",
    "        self.node_number+=1\n",
    "        branch.similarity=branch_similarity\n",
    "        branch.n_samples = len(y)\n",
    "        branch.X=X\n",
    "        branch.y=y\n",
    "\n",
    "        if depth==self.max_depth:\n",
    "            #print(\"leaf\")\n",
    "\n",
    "            return branch\n",
    "        else:\n",
    "            sr=self.find_best_split(X, y)\n",
    "            if sr.i_feature==-1:\n",
    "                return branch\n",
    "\n",
    "            sr.similarity_gain=sr.similarity-branch_similarity\n",
    "\n",
    "            #sr.print_me()\n",
    "            branch.i_feature=sr.i_feature\n",
    "            branch.split_value = sr.split_value\n",
    "            branch.split_quantile = sr.split_quantile\n",
    "            branch.similarity_gain=sr.similarity_gain\n",
    "            #print(\"branch\")\n",
    "            branch.left_branch=self.fit_inner(sr.left_X, sr.left_y, depth+1, branch_similarity=sr.left_similarity)\n",
    "            branch.right_branch=self.fit_inner(sr.right_X, sr.right_y, depth+1, branch_similarity=sr.right_similarity)\n",
    "\n",
    "            return branch\n",
    "        \n",
    "    def fit(self, X, y):\n",
    "        self.node_number=0\n",
    "        similarity=self.get_similarity(y)\n",
    "        self.tree=self.fit_inner(X, y, 0, branch_similarity=similarity)\n",
    "        \n",
    "    def prune_inner(self, b: Branch):\n",
    "        if b.is_leaf():\n",
    "            return\n",
    "        self.prune_inner(b.left_branch)\n",
    "        self.prune_inner(b.right_branch)\n",
    "        if b.left_branch.is_leaf() and b.right_branch.is_leaf():\n",
    "            if b.similarity_gain<self.gamma:\n",
    "                b.left_branch=None\n",
    "                b.right_branch=None\n",
    "        \n",
    "    def prune(self):\n",
    "        self.prune_inner(self.tree)\n",
    "        \n",
    "    def predict_one_inner(self, tree:Branch, x):\n",
    "        if tree.is_leaf():\n",
    "            return tree.value(self._lambda)\n",
    "        if x[tree.i_feature]<tree.split_value:\n",
    "            return self.predict_one_inner(tree.left_branch, x)\n",
    "        else:\n",
    "            return self.predict_one_inner(tree.right_branch, x)\n",
    "\n",
    "    def predict_inner(self, tree:Branch, X):\n",
    "        y=[]\n",
    "        for x in X:\n",
    "            t=self.predict_one_inner(tree, x)\n",
    "            y.append(t)\n",
    "        return np.array(y)\n",
    "\n",
    "    def predict(self, X):\n",
    "        return self.predict_inner(self.tree, X)\n",
    "    \n",
    "    def score(self, X, y):\n",
    "        y_hat = self.predict(X)\n",
    "        return r2_score(y, y_hat)\n",
    "\n",
    "    def export_graphviz_inner(self, the_branch:Branch, dot_data:str):\n",
    "        fillcolor = \"#ffffff\"\n",
    "        if the_branch.similarity_gain < self.gamma:\n",
    "            fillcolor = \"#ffaaaa\"\n",
    "        if the_branch.similarity_gain < 0:\n",
    "            fillcolor = \"#ff4444\"\n",
    "\n",
    "        if the_branch.is_leaf():\n",
    "            n_positive = sum(the_branch.y>=0)\n",
    "            n_negative = sum(the_branch.y<0)\n",
    "            dot_data += f\"{the_branch.no} [label=\\\"{the_branch.no}\\n\"+ \\\n",
    "            f\"samples={the_branch.n_samples:0.0f}\\\\n\" + \\\n",
    "            f\"+/- = {n_positive}/{n_negative}\\\\n\" + \\\n",
    "            f\"value={the_branch.value(self._lambda):0.3f}\\\\n\" + \\\n",
    "            f\"\\\", fillcolor=\\\"#22ee22\\\"];\"\n",
    "        else:\n",
    "            dot_data += f\"{the_branch.no} [label=\\\"{the_branch.no}\\n\"+ \\\n",
    "            f\"{feature_names[the_branch.i_feature]} <= {the_branch.split_value:0.3f}\\\\n\" + \\\n",
    "            f\"split_quantile = {the_branch.split_quantile:0.2f}\\\\n\" + \\\n",
    "            f\"samples = {the_branch.n_samples:0.0f}\\\\n\" + \\\n",
    "            f\"sim_gain = {the_branch.similarity_gain:0.3f}\\\\n\" + \\\n",
    "            f\"\\\", fillcolor=\\\"{fillcolor}\\\"];\"\n",
    "        #print(branch_str)\n",
    "        if not the_branch.left_branch is None:\n",
    "            left_branch=the_branch.left_branch\n",
    "            if left_branch.no>0:\n",
    "                dot_data += f\"{the_branch.no} -> {left_branch.no} ;\"\n",
    "                dot_data = self.export_graphviz_inner(left_branch, dot_data)\n",
    "        if not the_branch.right_branch is None:\n",
    "            right_branch=the_branch.right_branch\n",
    "            if right_branch.no>0:\n",
    "                dot_data += f\"{the_branch.no} -> {right_branch.no} ;\"\n",
    "                dot_data = self.export_graphviz_inner(right_branch, dot_data)\n",
    "        return dot_data\n",
    "\n",
    "    def export_graphviz(self):\n",
    "        dot_data=\"\"\"digraph Tree {\\nnode [shape=box, style=\"filled, rounded\", color=\"black\", fontname=helvetica] ;\\nedge [fontname=helvetica] ;\\n\"\"\"\n",
    "        dot_data+=self.export_graphviz_inner(self.tree, \"\")\n",
    "        dot_data+=\"}\"\n",
    "        dot_data=dot_data.replace(\"\\r\\n\",\"\\n\")\n",
    "        return dot_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"912pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 912.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 908,-429 908,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M505,-425C505,-425 386,-425 386,-425 380,-425 374,-419 374,-413 374,-413 374,-354 374,-354 374,-348 380,-342 386,-342 386,-342 505,-342 505,-342 511,-342 517,-348 517,-354 517,-354 517,-413 517,-413 517,-419 511,-425 505,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 168.274</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M419,-306C419,-306 300,-306 300,-306 294,-306 288,-300 288,-294 288,-294 288,-235 288,-235 288,-229 294,-223 300,-223 300,-223 419,-223 419,-223 425,-223 431,-229 431,-235 431,-235 431,-294 431,-294 431,-300 425,-306 419,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.287</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 47.377</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M415.663,-341.907C409.126,-333.014 402.139,-323.509 395.393,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"398.027,-312.005 389.285,-306.021 392.387,-316.151 398.027,-312.005\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M591,-306C591,-306 472,-306 472,-306 466,-306 460,-300 460,-294 460,-294 460,-235 460,-235 460,-229 466,-223 472,-223 472,-223 591,-223 591,-223 597,-223 603,-229 603,-235 603,-235 603,-294 603,-294 603,-300 597,-306 591,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 13.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.775</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M475.337,-341.907C481.874,-333.014 488.861,-323.509 495.607,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"498.613,-316.151 501.715,-306.021 492.973,-312.005 498.613,-316.151\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M220,-187C220,-187 101,-187 101,-187 95,-187 89,-181 89,-175 89,-175 89,-116 89,-116 89,-110 95,-104 101,-104 101,-104 220,-104 220,-104 226,-104 232,-110 232,-116 232,-116 232,-175 232,-175 232,-181 226,-187 220,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.630</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.806</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M290.458,-222.907C273.633,-213.016 255.523,-202.368 238.321,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"239.814,-189.072 229.42,-187.021 236.267,-195.106 239.814,-189.072\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M419,-187C419,-187 300,-187 300,-187 294,-187 288,-181 288,-175 288,-175 288,-116 288,-116 288,-110 294,-104 300,-104 300,-104 419,-104 419,-104 425,-104 431,-110 431,-116 431,-116 431,-175 431,-175 431,-181 425,-187 419,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.629</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"359.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.344</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M359.5,-222.907C359.5,-214.649 359.5,-205.864 359.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"363,-197.021 359.5,-187.021 356,-197.021 363,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.308</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M118.423,-103.726C108.822,-94.423 98.6263,-84.5428 89.048,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"91.4811,-72.7451 81.864,-68.2996 86.6098,-77.7721 91.4811,-72.7451\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M196,-68C196,-68 125,-68 125,-68 119,-68 113,-62 113,-56 113,-56 113,-12 113,-12 113,-6 119,-0 125,-0 125,-0 196,-0 196,-0 202,-0 208,-6 208,-12 208,-12 208,-56 208,-56 208,-62 202,-68 196,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 38/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.075</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M160.5,-103.726C160.5,-95.5175 160.5,-86.8595 160.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"164,-78.2996 160.5,-68.2996 157,-78.2996 164,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M309,-68C309,-68 238,-68 238,-68 232,-68 226,-62 226,-56 226,-56 226,-12 226,-12 226,-6 232,-0 238,-0 238,-0 309,-0 309,-0 315,-0 321,-6 321,-12 321,-12 321,-56 321,-56 321,-62 315,-68 309,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 7/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.499</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M327.477,-103.726C320.457,-94.7878 313.018,-85.3168 305.98,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"308.582,-74.0022 299.653,-68.2996 303.077,-78.3259 308.582,-74.0022\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M422,-68C422,-68 351,-68 351,-68 345,-68 339,-62 339,-56 339,-56 339,-12 339,-12 339,-6 345,-0 351,-0 351,-0 422,-0 422,-0 428,-0 434,-6 434,-12 434,-12 434,-56 434,-56 434,-62 428,-68 422,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"386.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"386.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"386.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 19/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"386.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=2.462</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M369.554,-103.726C371.6,-95.4263 373.76,-86.6671 375.827,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"379.293,-78.8467 378.289,-68.2996 372.497,-77.1709 379.293,-78.8467\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M591,-187C591,-187 472,-187 472,-187 466,-187 460,-181 460,-175 460,-175 460,-116 460,-116 460,-110 466,-104 472,-104 472,-104 591,-104 591,-104 597,-104 603,-110 603,-116 603,-116 603,-175 603,-175 603,-181 597,-187 591,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.438</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"531.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.789</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M531.5,-222.907C531.5,-214.649 531.5,-205.864 531.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"535,-197.021 531.5,-187.021 528,-197.021 535,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M797,-187C797,-187 678,-187 678,-187 672,-187 666,-181 666,-175 666,-175 666,-116 666,-116 666,-110 672,-104 678,-104 678,-104 797,-104 797,-104 803,-104 809,-110 809,-116 809,-116 809,-175 809,-175 809,-181 803,-187 797,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">CRIM &lt;= 4.286</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 152</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.634</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M602.971,-222.907C620.547,-212.925 639.479,-202.172 657.431,-191.976\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"659.189,-195.003 666.156,-187.021 655.732,-188.916 659.189,-195.003\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M544.5,-68C544.5,-68 464.5,-68 464.5,-68 458.5,-68 452.5,-62 452.5,-56 452.5,-56 452.5,-12 452.5,-12 452.5,-6 458.5,-0 464.5,-0 464.5,-0 544.5,-0 544.5,-0 550.5,-0 556.5,-6 556.5,-12 556.5,-12 556.5,-56 556.5,-56 556.5,-62 550.5,-68 544.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"504.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"504.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"504.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 35/78</text>\r\n",
       "<text text-anchor=\"middle\" x=\"504.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.123</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M521.446,-103.726C519.4,-95.4263 517.24,-86.6671 515.173,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"518.503,-77.1709 512.711,-68.2996 511.707,-78.8467 518.503,-77.1709\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M658,-68C658,-68 587,-68 587,-68 581,-68 575,-62 575,-56 575,-56 575,-12 575,-12 575,-6 581,-0 587,-0 587,-0 658,-0 658,-0 664,-0 670,-6 670,-12 670,-12 670,-56 670,-56 670,-62 664,-68 658,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.486</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M565.385,-103.726C572.889,-94.6966 580.845,-85.1235 588.359,-76.0816\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"591.127,-78.2275 594.826,-68.2996 585.743,-73.7534 591.127,-78.2275\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M775,-68C775,-68 700,-68 700,-68 694,-68 688,-62 688,-56 688,-56 688,-12 688,-12 688,-6 694,-0 700,-0 700,-0 775,-0 775,-0 781,-0 787,-6 787,-12 787,-12 787,-56 787,-56 787,-62 781,-68 775,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/70</text>\r\n",
       "<text text-anchor=\"middle\" x=\"737.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.469</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M737.5,-103.726C737.5,-95.5175 737.5,-86.8595 737.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"741,-78.2996 737.5,-68.2996 734,-78.2996 741,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M892,-68C892,-68 817,-68 817,-68 811,-68 805,-62 805,-56 805,-56 805,-12 805,-12 805,-6 811,-0 817,-0 817,-0 892,-0 892,-0 898,-0 904,-6 904,-12 904,-12 904,-56 904,-56 904,-62 898,-68 892,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"854.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"854.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"854.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"854.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.008</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M781.066,-103.726C791.007,-94.423 801.564,-84.5428 811.481,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"814.01,-77.6882 818.92,-68.2996 809.227,-72.5774 814.01,-77.6882\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b247f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "xdt = XGBTree()\n",
    "xdt.fit(X_train, y_train)\n",
    "dot_data=xdt.export_graphviz()\n",
    "graph = graphviz.Source(dot_data) \n",
    "display(graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"753pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 753.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 749,-429 749,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M413,-425C413,-425 294,-425 294,-425 288,-425 282,-419 282,-413 282,-413 282,-354 282,-354 282,-348 288,-342 294,-342 294,-342 413,-342 413,-342 419,-342 425,-348 425,-354 425,-354 425,-413 425,-413 425,-419 419,-425 413,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"353.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"353.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"353.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"353.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"353.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 168.274</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M333,-306C333,-306 214,-306 214,-306 208,-306 202,-300 202,-294 202,-294 202,-235 202,-235 202,-229 208,-223 214,-223 214,-223 333,-223 333,-223 339,-223 345,-229 345,-235 345,-235 345,-294 345,-294 345,-300 339,-306 333,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.287</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 47.377</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M325.744,-341.907C319.663,-333.014 313.164,-323.509 306.889,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"309.74,-312.3 301.207,-306.021 303.962,-316.251 309.74,-312.3\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M494,-306C494,-306 375,-306 375,-306 369,-306 363,-300 363,-294 363,-294 363,-235 363,-235 363,-229 369,-223 375,-223 375,-223 494,-223 494,-223 500,-223 506,-229 506,-235 506,-235 506,-294 506,-294 506,-300 500,-306 494,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"434.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"434.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 13.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"434.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"434.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"434.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.775</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M381.603,-341.907C387.76,-333.014 394.34,-323.509 400.694,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"403.633,-316.235 406.447,-306.021 397.877,-312.251 403.633,-316.235\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M208,-187C208,-187 89,-187 89,-187 83,-187 77,-181 77,-175 77,-175 77,-116 77,-116 77,-110 83,-104 89,-104 89,-104 208,-104 208,-104 214,-104 220,-110 220,-116 220,-116 220,-175 220,-175 220,-181 214,-187 208,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"148.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"148.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.630</text>\r\n",
       "<text text-anchor=\"middle\" x=\"148.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"148.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"148.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.806</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M230.132,-222.907C220.145,-213.56 209.438,-203.538 199.172,-193.929\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"201.484,-191.299 191.791,-187.021 196.701,-196.41 201.484,-191.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M321,-179.5C321,-179.5 250,-179.5 250,-179.5 244,-179.5 238,-173.5 238,-167.5 238,-167.5 238,-123.5 238,-123.5 238,-117.5 244,-111.5 250,-111.5 250,-111.5 321,-111.5 321,-111.5 327,-111.5 333,-117.5 333,-123.5 333,-123.5 333,-167.5 333,-167.5 333,-173.5 327,-179.5 321,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"285.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"285.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"285.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 26/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"285.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=2.268</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M277.663,-222.907C278.761,-212.204 279.95,-200.615 281.061,-189.776\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"284.56,-189.972 282.098,-179.667 277.596,-189.258 284.56,-189.972\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.308</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M110.891,-103.726C102.479,-94.6054 93.5542,-84.93 85.1401,-75.8078\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"87.5675,-73.2772 78.2147,-68.2996 82.422,-78.0232 87.5675,-73.2772\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M196,-68C196,-68 125,-68 125,-68 119,-68 113,-62 113,-56 113,-56 113,-12 113,-12 113,-6 119,-0 125,-0 125,-0 196,-0 196,-0 202,-0 208,-6 208,-12 208,-12 208,-56 208,-56 208,-62 202,-68 196,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 38/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.075</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M152.968,-103.726C153.878,-95.4263 154.838,-86.6671 155.757,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"159.24,-78.6214 156.851,-68.2996 152.282,-77.8588 159.24,-78.6214\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M488,-187C488,-187 369,-187 369,-187 363,-187 357,-181 357,-175 357,-175 357,-116 357,-116 357,-110 363,-104 369,-104 369,-104 488,-104 488,-104 494,-104 500,-110 500,-116 500,-116 500,-175 500,-175 500,-181 494,-187 488,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"428.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"428.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.438</text>\r\n",
       "<text text-anchor=\"middle\" x=\"428.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"428.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"428.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.789</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M432.418,-222.907C431.99,-214.558 431.534,-205.671 431.091,-197.02\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"434.586,-196.828 430.578,-187.021 427.595,-197.187 434.586,-196.828\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M649,-187C649,-187 530,-187 530,-187 524,-187 518,-181 518,-175 518,-175 518,-116 518,-116 518,-110 524,-104 530,-104 530,-104 649,-104 649,-104 655,-104 661,-110 661,-116 661,-116 661,-175 661,-175 661,-181 655,-187 649,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"589.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"589.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">CRIM &lt;= 4.286</text>\r\n",
       "<text text-anchor=\"middle\" x=\"589.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"589.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 152</text>\r\n",
       "<text text-anchor=\"middle\" x=\"589.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.634</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M488.276,-222.907C501.02,-213.288 514.711,-202.953 527.778,-193.09\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"529.946,-195.839 535.819,-187.021 525.728,-190.252 529.946,-195.839\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M363.5,-68C363.5,-68 283.5,-68 283.5,-68 277.5,-68 271.5,-62 271.5,-56 271.5,-56 271.5,-12 271.5,-12 271.5,-6 277.5,-0 283.5,-0 283.5,-0 363.5,-0 363.5,-0 369.5,-0 375.5,-6 375.5,-12 375.5,-12 375.5,-56 375.5,-56 375.5,-62 369.5,-68 363.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"323.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"323.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"323.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 35/78</text>\r\n",
       "<text text-anchor=\"middle\" x=\"323.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.123</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M389.402,-103.726C380.568,-94.5142 371.192,-84.7364 362.369,-75.5343\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"364.879,-73.095 355.431,-68.2996 359.826,-77.9399 364.879,-73.095\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M477,-68C477,-68 406,-68 406,-68 400,-68 394,-62 394,-56 394,-56 394,-12 394,-12 394,-6 400,-0 406,-0 406,-0 477,-0 477,-0 483,-0 489,-6 489,-12 489,-12 489,-56 489,-56 489,-62 483,-68 477,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"441.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"441.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"441.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"441.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.486</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M433.341,-103.726C434.326,-95.4263 435.366,-86.6671 436.361,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"439.843,-78.6425 437.547,-68.2996 432.892,-77.8172 439.843,-78.6425\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M616,-68C616,-68 541,-68 541,-68 535,-68 529,-62 529,-56 529,-56 529,-12 529,-12 529,-6 535,-0 541,-0 541,-0 616,-0 616,-0 622,-0 628,-6 628,-12 628,-12 628,-56 628,-56 628,-62 622,-68 616,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"578.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"578.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"578.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/70</text>\r\n",
       "<text text-anchor=\"middle\" x=\"578.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.469</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M585.404,-103.726C584.57,-95.4263 583.69,-86.6671 582.848,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"586.327,-77.8997 581.845,-68.2996 579.362,-78.5994 586.327,-77.8997\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M733,-68C733,-68 658,-68 658,-68 652,-68 646,-62 646,-56 646,-56 646,-12 646,-12 646,-6 652,-0 658,-0 658,-0 733,-0 733,-0 739,-0 745,-6 745,-12 745,-12 745,-56 745,-56 745,-62 739,-68 733,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"695.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"695.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"695.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"695.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.008</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M628.97,-103.726C637.888,-94.5142 647.353,-84.7364 656.261,-75.5343\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"658.824,-77.919 663.265,-68.2996 653.795,-73.0502 658.824,-77.919\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2bab2c250>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "xdt.prune()\n",
    "dot_data=xdt.export_graphviz()\n",
    "graph = graphviz.Source(dot_data) \n",
    "display(graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7130323772682939"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "0.7502833075803663"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "0.567403826763406"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(xdt.score(X, y))\n",
    "display(xdt.score(X_train, y_train))\n",
    "display(xdt.score(X_test, y_test))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 1 Average"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>CRIM</th>\n",
       "      <th>ZN</th>\n",
       "      <th>INDUS</th>\n",
       "      <th>CHAS</th>\n",
       "      <th>NOX</th>\n",
       "      <th>RM</th>\n",
       "      <th>AGE</th>\n",
       "      <th>DIS</th>\n",
       "      <th>RAD</th>\n",
       "      <th>TAX</th>\n",
       "      <th>PTRATIO</th>\n",
       "      <th>B</th>\n",
       "      <th>LSTAT</th>\n",
       "      <th>ONE</th>\n",
       "      <th>PRICE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.00632</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.31</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.538</td>\n",
       "      <td>6.575</td>\n",
       "      <td>65.2</td>\n",
       "      <td>4.0900</td>\n",
       "      <td>1.0</td>\n",
       "      <td>296.0</td>\n",
       "      <td>15.3</td>\n",
       "      <td>396.90</td>\n",
       "      <td>4.98</td>\n",
       "      <td>1</td>\n",
       "      <td>0.159686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.02731</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>6.421</td>\n",
       "      <td>78.9</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>396.90</td>\n",
       "      <td>9.14</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.101524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.02729</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.469</td>\n",
       "      <td>7.185</td>\n",
       "      <td>61.1</td>\n",
       "      <td>4.9671</td>\n",
       "      <td>2.0</td>\n",
       "      <td>242.0</td>\n",
       "      <td>17.8</td>\n",
       "      <td>392.83</td>\n",
       "      <td>4.03</td>\n",
       "      <td>1</td>\n",
       "      <td>1.324247</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.03237</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>6.998</td>\n",
       "      <td>45.8</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>394.63</td>\n",
       "      <td>2.94</td>\n",
       "      <td>1</td>\n",
       "      <td>1.182758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.06905</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.458</td>\n",
       "      <td>7.147</td>\n",
       "      <td>54.2</td>\n",
       "      <td>6.0622</td>\n",
       "      <td>3.0</td>\n",
       "      <td>222.0</td>\n",
       "      <td>18.7</td>\n",
       "      <td>396.90</td>\n",
       "      <td>5.33</td>\n",
       "      <td>1</td>\n",
       "      <td>1.487503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>501</th>\n",
       "      <td>0.06263</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.573</td>\n",
       "      <td>6.593</td>\n",
       "      <td>69.1</td>\n",
       "      <td>2.4786</td>\n",
       "      <td>1.0</td>\n",
       "      <td>273.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>391.99</td>\n",
       "      <td>9.67</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.014454</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>502</th>\n",
       "      <td>0.04527</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.573</td>\n",
       "      <td>6.120</td>\n",
       "      <td>76.7</td>\n",
       "      <td>2.2875</td>\n",
       "      <td>1.0</td>\n",
       "      <td>273.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>396.90</td>\n",
       "      <td>9.08</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.210362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>503</th>\n",
       "      <td>0.06076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.573</td>\n",
       "      <td>6.976</td>\n",
       "      <td>91.0</td>\n",
       "      <td>2.1675</td>\n",
       "      <td>1.0</td>\n",
       "      <td>273.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>396.90</td>\n",
       "      <td>5.64</td>\n",
       "      <td>1</td>\n",
       "      <td>0.148802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>504</th>\n",
       "      <td>0.10959</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.573</td>\n",
       "      <td>6.794</td>\n",
       "      <td>89.3</td>\n",
       "      <td>2.3889</td>\n",
       "      <td>1.0</td>\n",
       "      <td>273.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>393.45</td>\n",
       "      <td>6.48</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.057989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>505</th>\n",
       "      <td>0.04741</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.573</td>\n",
       "      <td>6.030</td>\n",
       "      <td>80.8</td>\n",
       "      <td>2.5050</td>\n",
       "      <td>1.0</td>\n",
       "      <td>273.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>396.90</td>\n",
       "      <td>7.88</td>\n",
       "      <td>1</td>\n",
       "      <td>-1.157248</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>506 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        CRIM    ZN  INDUS CHAS    NOX     RM   AGE     DIS  RAD    TAX  \\\n",
       "0    0.00632  18.0   2.31  0.0  0.538  6.575  65.2  4.0900  1.0  296.0   \n",
       "1    0.02731   0.0   7.07  0.0  0.469  6.421  78.9  4.9671  2.0  242.0   \n",
       "2    0.02729   0.0   7.07  0.0  0.469  7.185  61.1  4.9671  2.0  242.0   \n",
       "3    0.03237   0.0   2.18  0.0  0.458  6.998  45.8  6.0622  3.0  222.0   \n",
       "4    0.06905   0.0   2.18  0.0  0.458  7.147  54.2  6.0622  3.0  222.0   \n",
       "..       ...   ...    ...  ...    ...    ...   ...     ...  ...    ...   \n",
       "501  0.06263   0.0  11.93  0.0  0.573  6.593  69.1  2.4786  1.0  273.0   \n",
       "502  0.04527   0.0  11.93  0.0  0.573  6.120  76.7  2.2875  1.0  273.0   \n",
       "503  0.06076   0.0  11.93  0.0  0.573  6.976  91.0  2.1675  1.0  273.0   \n",
       "504  0.10959   0.0  11.93  0.0  0.573  6.794  89.3  2.3889  1.0  273.0   \n",
       "505  0.04741   0.0  11.93  0.0  0.573  6.030  80.8  2.5050  1.0  273.0   \n",
       "\n",
       "    PTRATIO       B LSTAT ONE     PRICE  \n",
       "0      15.3  396.90  4.98   1  0.159686  \n",
       "1      17.8  396.90  9.14   1 -0.101524  \n",
       "2      17.8  392.83  4.03   1  1.324247  \n",
       "3      18.7  394.63  2.94   1  1.182758  \n",
       "4      18.7  396.90  5.33   1  1.487503  \n",
       "..      ...     ...   ...  ..       ...  \n",
       "501    21.0  391.99  9.67   1 -0.014454  \n",
       "502    21.0  396.90  9.08   1 -0.210362  \n",
       "503    21.0  396.90  5.64   1  0.148802  \n",
       "504    21.0  393.45  6.48   1 -0.057989  \n",
       "505    21.0  396.90  7.88   1 -1.157248  \n",
       "\n",
       "[506 rows x 15 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#now let's get started\n",
    "learning_rate=0.3\n",
    "loss = [0] * 6\n",
    "residuals = np.zeros([6,n_train])\n",
    "prediction = np.zeros([6,n_train])\n",
    "#calculation\n",
    "#average_y=y.mean()\n",
    "prediction[0] = [0.5] * n_train\n",
    "residuals[0] = y_train - prediction[0]\n",
    "df_train['$f_0$']=np.array(prediction[0]).reshape((-1, 1))\n",
    "df_train['$r_0$']=np.array(residuals[0]).reshape((-1, 1))\n",
    "display(df)\n",
    "loss[0] = np.sum(residuals[0] ** 2)\n",
    "trees = []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(404,)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction[0].shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the first step, we calculate the average 71.2 as the initial prediction. The pseudo residuals are 16.8, 4.8, etc."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 2 For Loop"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def iterate(i):\n",
    "    t = XGBTree(max_depth=3, gamma=5)\n",
    "    t.fit(X_train,residuals[i])\n",
    "    trees.append(t)\n",
    "    \n",
    "    dot_data = t.export_graphviz()\n",
    "    graph = graphviz.Source(dot_data) \n",
    "    display(graph)\n",
    "    t.prune()\n",
    "    dot_data = t.export_graphviz()\n",
    "    graph = graphviz.Source(dot_data) \n",
    "    display(graph)\n",
    "    #next prediction, residual\n",
    "    prediction[i+1]=prediction[i]+learning_rate * t.predict(X_train)\n",
    "    residuals[i+1]=y_train-prediction[i+1]\n",
    "    loss[i+1] = np.sum(residuals[i+1] ** 2)/n_train\n",
    "    y_hat=t.predict(X_train)\n",
    "    df_train[f'$\\gamma_{i+1}$']=y_hat.reshape((-1,1))\n",
    "    df_train[f'$f_{i+1}$']=np.array(prediction[i+1]).reshape((-1,1))\n",
    "    df_train[f'$r_{i+1}$']=np.array(residuals[i+1]).reshape((-1,1))\n",
    "    if i==0:\n",
    "        display(df_train[[f'$f_{i}$',f'$r_{i}$',f'$\\gamma_{i+1}$',f'$f_{i+1}$',f'$r_{i+1}$']])\n",
    "    else:\n",
    "        display(df_train[[\"PRICE\",f'$f_{i}$',f'$r_{i}$',f'$\\gamma_{i+1}$',f'$f_{i+1}$',f'$r_{i+1}$']])\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"920pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 920.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 916,-429 916,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M509,-425C509,-425 390,-425 390,-425 384,-425 378,-419 378,-413 378,-413 378,-354 378,-354 378,-348 384,-342 390,-342 390,-342 509,-342 509,-342 515,-342 521,-348 521,-354 521,-354 521,-413 521,-413 521,-419 515,-425 509,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 168.780</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M423,-306C423,-306 304,-306 304,-306 298,-306 292,-300 292,-294 292,-294 292,-235 292,-235 292,-229 298,-223 304,-223 304,-223 423,-223 423,-223 429,-223 435,-229 435,-235 435,-235 435,-294 435,-294 435,-300 429,-306 423,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.287</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 48.984</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M419.663,-341.907C413.126,-333.014 406.139,-323.509 399.393,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"402.027,-312.005 393.285,-306.021 396.387,-316.151 402.027,-312.005\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M595,-306C595,-306 476,-306 476,-306 470,-306 464,-300 464,-294 464,-294 464,-235 464,-235 464,-229 470,-223 476,-223 476,-223 595,-223 595,-223 601,-223 607,-229 607,-235 607,-235 607,-294 607,-294 607,-300 601,-306 595,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 13.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.174</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M479.337,-341.907C485.874,-333.014 492.861,-323.509 499.607,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"502.613,-316.151 505.715,-306.021 496.973,-312.005 502.613,-316.151\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M224,-187C224,-187 105,-187 105,-187 99,-187 93,-181 93,-175 93,-175 93,-116 93,-116 93,-110 99,-104 105,-104 105,-104 224,-104 224,-104 230,-104 236,-110 236,-116 236,-116 236,-175 236,-175 236,-181 230,-187 224,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.630</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 11.243</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M294.458,-222.907C277.633,-213.016 259.523,-202.368 242.321,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"243.814,-189.072 233.42,-187.021 240.267,-195.106 243.814,-189.072\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M423,-187C423,-187 304,-187 304,-187 298,-187 292,-181 292,-175 292,-175 292,-116 292,-116 292,-110 298,-104 304,-104 304,-104 423,-104 423,-104 429,-104 435,-110 435,-116 435,-116 435,-175 435,-175 435,-181 429,-187 423,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.629</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"363.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.822</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M363.5,-222.907C363.5,-214.649 363.5,-205.864 363.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"367,-197.021 363.5,-187.021 360,-197.021 367,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 7/30</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.178</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M121.678,-103.726C111.908,-94.423 101.531,-84.5428 91.7834,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"94.1279,-72.6606 84.4722,-68.2996 89.3008,-77.7301 94.1279,-72.6606\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.587</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.726C164.5,-95.5175 164.5,-86.8595 164.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2996 164.5,-68.2996 161,-78.2996 168,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M313,-68C313,-68 242,-68 242,-68 236,-68 230,-62 230,-56 230,-56 230,-12 230,-12 230,-6 236,-0 242,-0 242,-0 313,-0 313,-0 319,-0 325,-6 325,-12 325,-12 325,-56 325,-56 325,-62 319,-68 313,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 7/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.061</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M331.477,-103.726C324.457,-94.7878 317.018,-85.3168 309.98,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"312.582,-74.0022 303.653,-68.2996 307.077,-78.3259 312.582,-74.0022\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M426,-68C426,-68 355,-68 355,-68 349,-68 343,-62 343,-56 343,-56 343,-12 343,-12 343,-6 349,-0 355,-0 355,-0 426,-0 426,-0 432,-0 438,-6 438,-12 438,-12 438,-56 438,-56 438,-62 432,-68 426,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"390.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"390.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"390.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 19/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"390.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.987</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M373.554,-103.726C375.6,-95.4263 377.76,-86.6671 379.827,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"383.293,-78.8467 382.289,-68.2996 376.497,-77.1709 383.293,-78.8467\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M595,-187C595,-187 476,-187 476,-187 470,-187 464,-181 464,-175 464,-175 464,-116 464,-116 464,-110 470,-104 476,-104 476,-104 595,-104 595,-104 601,-104 607,-110 607,-116 607,-116 607,-175 607,-175 607,-181 601,-187 595,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.438</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.877</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M535.5,-222.907C535.5,-214.649 535.5,-205.864 535.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"539,-197.021 535.5,-187.021 532,-197.021 539,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M805,-187C805,-187 686,-187 686,-187 680,-187 674,-181 674,-175 674,-175 674,-116 674,-116 674,-110 680,-104 686,-104 686,-104 805,-104 805,-104 811,-104 817,-110 817,-116 817,-116 817,-175 817,-175 817,-181 811,-187 805,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">CRIM &lt;= 4.286</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 152</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 9.655</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M607.183,-223.562C625.749,-213.219 645.865,-202.011 664.856,-191.43\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"666.752,-194.381 673.784,-186.456 663.345,-188.266 666.752,-194.381\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M548.5,-68C548.5,-68 468.5,-68 468.5,-68 462.5,-68 456.5,-62 456.5,-56 456.5,-56 456.5,-12 456.5,-12 456.5,-6 462.5,-0 468.5,-0 468.5,-0 548.5,-0 548.5,-0 554.5,-0 560.5,-6 560.5,-12 560.5,-12 560.5,-56 560.5,-56 560.5,-62 554.5,-68 548.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"508.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"508.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"508.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 5/108</text>\r\n",
       "<text text-anchor=\"middle\" x=\"508.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.619</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M525.446,-103.726C523.4,-95.4263 521.24,-86.6671 519.173,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"522.503,-77.1709 516.711,-68.2996 515.707,-78.8467 522.503,-77.1709\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M666,-68C666,-68 591,-68 591,-68 585,-68 579,-62 579,-56 579,-56 579,-12 579,-12 579,-6 585,-0 591,-0 591,-0 666,-0 666,-0 672,-0 678,-6 678,-12 678,-12 678,-56 678,-56 678,-62 672,-68 666,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 17/21</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.001</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M570.13,-103.726C577.799,-94.6966 585.929,-85.1235 593.609,-76.0816\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"596.412,-78.1873 600.218,-68.2996 591.077,-73.6559 596.412,-78.1873\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M783,-68C783,-68 708,-68 708,-68 702,-68 696,-62 696,-56 696,-56 696,-12 696,-12 696,-6 702,-0 708,-0 708,-0 783,-0 783,-0 789,-0 795,-6 795,-12 795,-12 795,-56 795,-56 795,-62 789,-68 783,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.963</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M745.5,-103.726C745.5,-95.5175 745.5,-86.8595 745.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"749,-78.2996 745.5,-68.2996 742,-78.2996 749,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M900,-68C900,-68 825,-68 825,-68 819,-68 813,-62 813,-56 813,-56 813,-12 813,-12 813,-6 819,-0 825,-0 825,-0 900,-0 900,-0 906,-0 912,-6 912,-12 912,-12 912,-56 912,-56 912,-62 906,-68 900,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.502</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M789.066,-103.726C799.007,-94.423 809.564,-84.5428 819.481,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"822.01,-77.6882 826.92,-68.2996 817.227,-72.5774 822.01,-77.6882\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c08f8640>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"758pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 758.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 754,-429 754,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M418,-425C418,-425 299,-425 299,-425 293,-425 287,-419 287,-413 287,-413 287,-354 287,-354 287,-348 293,-342 299,-342 299,-342 418,-342 418,-342 424,-342 430,-348 430,-354 430,-354 430,-413 430,-413 430,-419 424,-425 418,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"358.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"358.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"358.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"358.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"358.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 168.780</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M338,-306C338,-306 219,-306 219,-306 213,-306 207,-300 207,-294 207,-294 207,-235 207,-235 207,-229 213,-223 219,-223 219,-223 338,-223 338,-223 344,-223 350,-229 350,-235 350,-235 350,-294 350,-294 350,-300 344,-306 338,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"278.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"278.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.287</text>\r\n",
       "<text text-anchor=\"middle\" x=\"278.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"278.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"278.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 48.984</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M330.744,-341.907C324.663,-333.014 318.164,-323.509 311.889,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"314.74,-312.3 306.207,-306.021 308.962,-316.251 314.74,-312.3\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M499,-306C499,-306 380,-306 380,-306 374,-306 368,-300 368,-294 368,-294 368,-235 368,-235 368,-229 374,-223 380,-223 380,-223 499,-223 499,-223 505,-223 511,-229 511,-235 511,-235 511,-294 511,-294 511,-300 505,-306 499,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"439.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"439.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 13.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"439.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"439.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"439.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.174</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M386.603,-341.907C392.76,-333.014 399.34,-323.509 405.694,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"408.633,-316.235 411.447,-306.021 402.877,-312.251 408.633,-316.235\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M213,-187C213,-187 94,-187 94,-187 88,-187 82,-181 82,-175 82,-175 82,-116 82,-116 82,-110 88,-104 94,-104 94,-104 213,-104 213,-104 219,-104 225,-110 225,-116 225,-116 225,-175 225,-175 225,-181 219,-187 213,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"153.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"153.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.630</text>\r\n",
       "<text text-anchor=\"middle\" x=\"153.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"153.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"153.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 11.243</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M235.132,-222.907C225.145,-213.56 214.438,-203.538 204.172,-193.929\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"206.484,-191.299 196.791,-187.021 201.701,-196.41 206.484,-191.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M326,-179.5C326,-179.5 255,-179.5 255,-179.5 249,-179.5 243,-173.5 243,-167.5 243,-167.5 243,-123.5 243,-123.5 243,-117.5 249,-111.5 255,-111.5 255,-111.5 326,-111.5 326,-111.5 332,-111.5 338,-117.5 338,-123.5 338,-123.5 338,-167.5 338,-167.5 338,-173.5 332,-179.5 326,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"290.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"290.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"290.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 26/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"290.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.787</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M282.663,-222.907C283.761,-212.204 284.95,-200.615 286.061,-189.776\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"289.56,-189.972 287.098,-179.667 282.596,-189.258 289.56,-189.972\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 7/30</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.178</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M114.774,-103.726C106.112,-94.6054 96.9221,-84.93 88.2581,-75.8078\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"90.5515,-73.1401 81.127,-68.2996 85.4759,-77.9608 90.5515,-73.1401\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.587</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M157.596,-103.726C158.43,-95.4263 159.31,-86.6671 160.152,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"163.638,-78.5994 161.155,-68.2996 156.673,-77.8997 163.638,-78.5994\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M493,-187C493,-187 374,-187 374,-187 368,-187 362,-181 362,-175 362,-175 362,-116 362,-116 362,-110 368,-104 374,-104 374,-104 493,-104 493,-104 499,-104 505,-110 505,-116 505,-116 505,-175 505,-175 505,-181 499,-187 493,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.438</text>\r\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.877</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M437.418,-222.907C436.99,-214.558 436.534,-205.671 436.091,-197.02\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"439.586,-196.828 435.578,-187.021 432.595,-197.187 439.586,-196.828\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M654,-187C654,-187 535,-187 535,-187 529,-187 523,-181 523,-175 523,-175 523,-116 523,-116 523,-110 529,-104 535,-104 535,-104 654,-104 654,-104 660,-104 666,-110 666,-116 666,-116 666,-175 666,-175 666,-181 660,-187 654,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"594.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"594.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">CRIM &lt;= 4.286</text>\r\n",
       "<text text-anchor=\"middle\" x=\"594.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"594.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 152</text>\r\n",
       "<text text-anchor=\"middle\" x=\"594.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 9.655</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M493.276,-222.907C506.02,-213.288 519.711,-202.953 532.778,-193.09\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"534.946,-195.839 540.819,-187.021 530.728,-190.252 534.946,-195.839\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M365.5,-68C365.5,-68 285.5,-68 285.5,-68 279.5,-68 273.5,-62 273.5,-56 273.5,-56 273.5,-12 273.5,-12 273.5,-6 279.5,-0 285.5,-0 285.5,-0 365.5,-0 365.5,-0 371.5,-0 377.5,-6 377.5,-12 377.5,-12 377.5,-56 377.5,-56 377.5,-62 371.5,-68 365.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"325.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"325.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"325.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 5/108</text>\r\n",
       "<text text-anchor=\"middle\" x=\"325.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.619</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M393.285,-103.726C384.199,-94.5142 374.555,-84.7364 365.479,-75.5343\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"367.857,-72.9615 358.343,-68.2996 362.874,-77.877 367.857,-72.9615\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M483,-68C483,-68 408,-68 408,-68 402,-68 396,-62 396,-56 396,-56 396,-12 396,-12 396,-6 402,-0 408,-0 408,-0 483,-0 483,-0 489,-0 495,-6 495,-12 495,-12 495,-56 495,-56 495,-62 489,-68 483,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 17/21</text>\r\n",
       "<text text-anchor=\"middle\" x=\"445.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.001</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M437.968,-103.726C438.878,-95.4263 439.838,-86.6671 440.757,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"444.24,-78.6214 441.851,-68.2996 437.282,-77.8588 444.24,-78.6214\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M621,-68C621,-68 546,-68 546,-68 540,-68 534,-62 534,-56 534,-56 534,-12 534,-12 534,-6 540,-0 546,-0 546,-0 621,-0 621,-0 627,-0 633,-6 633,-12 633,-12 633,-56 633,-56 633,-62 627,-68 621,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"583.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"583.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"583.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"583.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.963</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M590.404,-103.726C589.57,-95.4263 588.69,-86.6671 587.848,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"591.327,-77.8997 586.845,-68.2996 584.362,-78.5994 591.327,-77.8997\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M738,-68C738,-68 663,-68 663,-68 657,-68 651,-62 651,-56 651,-56 651,-12 651,-12 651,-6 657,-0 663,-0 663,-0 738,-0 738,-0 744,-0 750,-6 750,-12 750,-12 750,-56 750,-56 750,-62 744,-68 738,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"700.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"700.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"700.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 1/75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"700.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.502</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M633.97,-103.726C642.888,-94.5142 652.353,-84.7364 661.261,-75.5343\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"663.824,-77.919 668.265,-68.2996 658.795,-73.0502 663.824,-77.919\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b30820>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>$f_0$</th>\n",
       "      <th>$r_0$</th>\n",
       "      <th>$\\gamma_1$</th>\n",
       "      <th>$f_1$</th>\n",
       "      <th>$r_1$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.5</td>\n",
       "      <td>0.290943</td>\n",
       "      <td>-0.178413</td>\n",
       "      <td>0.446476</td>\n",
       "      <td>0.344467</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.666827</td>\n",
       "      <td>-0.618970</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.481136</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.819199</td>\n",
       "      <td>-0.618970</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.633508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.971572</td>\n",
       "      <td>-0.618970</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.785881</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.5</td>\n",
       "      <td>2.489460</td>\n",
       "      <td>0.587391</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>2.313243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.938920</td>\n",
       "      <td>-0.618970</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.753229</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.557989</td>\n",
       "      <td>-0.618970</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.372298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>0.5</td>\n",
       "      <td>0.095036</td>\n",
       "      <td>0.587391</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>-0.081182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>0.5</td>\n",
       "      <td>0.367129</td>\n",
       "      <td>0.587391</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>0.190912</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>0.5</td>\n",
       "      <td>0.040617</td>\n",
       "      <td>-1.501869</td>\n",
       "      <td>0.049439</td>\n",
       "      <td>0.491178</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>404 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    $f_0$     $r_0$ $\\gamma_1$     $f_1$     $r_1$\n",
       "0     0.5  0.290943  -0.178413  0.446476  0.344467\n",
       "1     0.5 -0.666827  -0.618970  0.314309 -0.481136\n",
       "2     0.5 -0.819199  -0.618970  0.314309 -0.633508\n",
       "3     0.5 -0.971572  -0.618970  0.314309 -0.785881\n",
       "4     0.5  2.489460   0.587391  0.676217  2.313243\n",
       "..    ...       ...        ...       ...       ...\n",
       "399   0.5 -0.938920  -0.618970  0.314309 -0.753229\n",
       "400   0.5 -0.557989  -0.618970  0.314309 -0.372298\n",
       "401   0.5  0.095036   0.587391  0.676217 -0.081182\n",
       "402   0.5  0.367129   0.587391  0.676217  0.190912\n",
       "403   0.5  0.040617  -1.501869  0.049439  0.491178\n",
       "\n",
       "[404 rows x 5 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"925pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 924.50 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 920.5,-429 920.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M527.5,-425C527.5,-425 408.5,-425 408.5,-425 402.5,-425 396.5,-419 396.5,-413 396.5,-413 396.5,-354 396.5,-354 396.5,-348 402.5,-342 408.5,-342 408.5,-342 527.5,-342 527.5,-342 533.5,-342 539.5,-348 539.5,-354 539.5,-354 539.5,-413 539.5,-413 539.5,-419 533.5,-425 527.5,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"468\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"468\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.620</text>\r\n",
       "<text text-anchor=\"middle\" x=\"468\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"468\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"468\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 84.885</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M439.5,-306C439.5,-306 320.5,-306 320.5,-306 314.5,-306 308.5,-300 308.5,-294 308.5,-294 308.5,-235 308.5,-235 308.5,-229 314.5,-223 320.5,-223 320.5,-223 439.5,-223 439.5,-223 445.5,-223 451.5,-229 451.5,-235 451.5,-235 451.5,-294 451.5,-294 451.5,-300 445.5,-306 439.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 17.590</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 22.031</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M437.469,-341.907C430.711,-332.923 423.485,-323.315 416.516,-314.05\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"419.285,-311.909 410.477,-306.021 413.691,-316.116 419.285,-311.909\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M615.5,-306C615.5,-306 496.5,-306 496.5,-306 490.5,-306 484.5,-300 484.5,-294 484.5,-294 484.5,-235 484.5,-235 484.5,-229 490.5,-223 496.5,-223 496.5,-223 615.5,-223 615.5,-223 621.5,-223 627.5,-229 627.5,-235 627.5,-235 627.5,-294 627.5,-294 627.5,-300 621.5,-306 615.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.416</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 31.817</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M498.531,-341.907C505.289,-332.923 512.515,-323.315 519.484,-314.05\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"522.309,-316.116 525.523,-306.021 516.715,-311.909 522.309,-316.116\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M233.5,-187C233.5,-187 114.5,-187 114.5,-187 108.5,-187 102.5,-181 102.5,-175 102.5,-175 102.5,-116 102.5,-116 102.5,-110 108.5,-104 114.5,-104 114.5,-104 233.5,-104 233.5,-104 239.5,-104 245.5,-110 245.5,-116 245.5,-116 245.5,-175 245.5,-175 245.5,-181 239.5,-187 233.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 11.120</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 227</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.867</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M308.529,-222.907C290.953,-212.925 272.021,-202.172 254.069,-191.976\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"255.768,-188.916 245.344,-187.021 252.311,-195.003 255.768,-188.916\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M439.5,-187C439.5,-187 320.5,-187 320.5,-187 314.5,-187 308.5,-181 308.5,-175 308.5,-175 308.5,-116 308.5,-116 308.5,-110 314.5,-104 320.5,-104 320.5,-104 439.5,-104 439.5,-104 445.5,-104 451.5,-110 451.5,-116 451.5,-116 451.5,-175 451.5,-175 451.5,-181 445.5,-187 439.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">NOX &lt;= 0.668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"380\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.479</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M380,-222.907C380,-214.649 380,-205.864 380,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"383.5,-197.021 380,-187.021 376.5,-197.021 383.5,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.279</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M128.572,-103.726C118.105,-94.3318 106.982,-84.349 96.5532,-74.9883\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"98.8808,-72.3744 89.1009,-68.2996 94.2051,-77.5839 98.8808,-72.3744\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M214,-68C214,-68 134,-68 134,-68 128,-68 122,-62 122,-56 122,-56 122,-12 122,-12 122,-6 128,-0 134,-0 134,-0 214,-0 214,-0 220,-0 226,-6 226,-12 226,-12 226,-56 226,-56 226,-62 220,-68 214,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=114</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 3/111</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.604</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M174,-103.726C174,-95.5175 174,-86.8595 174,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"177.5,-78.2996 174,-68.2996 170.5,-78.2996 177.5,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M331.5,-68C331.5,-68 256.5,-68 256.5,-68 250.5,-68 244.5,-62 244.5,-56 244.5,-56 244.5,-12 244.5,-12 244.5,-6 250.5,-0 256.5,-0 256.5,-0 331.5,-0 331.5,-0 337.5,-0 343.5,-6 343.5,-12 343.5,-12 343.5,-56 343.5,-56 343.5,-62 337.5,-68 331.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"294\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"294\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"294\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"294\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.805</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M347.977,-103.726C340.957,-94.7878 333.518,-85.3168 326.48,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"329.082,-74.0022 320.153,-68.2996 323.577,-78.3259 329.082,-74.0022\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M448.5,-68C448.5,-68 373.5,-68 373.5,-68 367.5,-68 361.5,-62 361.5,-56 361.5,-56 361.5,-12 361.5,-12 361.5,-6 367.5,-0 373.5,-0 373.5,-0 448.5,-0 448.5,-0 454.5,-0 460.5,-6 460.5,-12 460.5,-12 460.5,-56 460.5,-56 460.5,-62 454.5,-68 448.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"411\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"411\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=39</text>\r\n",
       "<text text-anchor=\"middle\" x=\"411\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/39</text>\r\n",
       "<text text-anchor=\"middle\" x=\"411\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.291</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M391.543,-103.726C393.919,-95.3351 396.427,-86.4745 398.824,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"402.216,-78.8749 401.573,-68.2996 395.481,-76.968 402.216,-78.8749\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M615.5,-187C615.5,-187 496.5,-187 496.5,-187 490.5,-187 484.5,-181 484.5,-175 484.5,-175 484.5,-116 484.5,-116 484.5,-110 490.5,-104 496.5,-104 496.5,-104 615.5,-104 615.5,-104 621.5,-104 627.5,-110 627.5,-116 627.5,-116 627.5,-175 627.5,-175 627.5,-181 621.5,-187 615.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 9.640</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"556\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 11.325</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M556,-222.907C556,-214.649 556,-205.864 556,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"559.5,-197.021 556,-187.021 552.5,-197.021 559.5,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M818.5,-187C818.5,-187 693.5,-187 693.5,-187 687.5,-187 681.5,-181 681.5,-175 681.5,-175 681.5,-116 681.5,-116 681.5,-110 687.5,-104 693.5,-104 693.5,-104 818.5,-104 818.5,-104 824.5,-104 830.5,-110 830.5,-116 830.5,-116 830.5,-175 830.5,-175 830.5,-181 824.5,-187 818.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">PTRATIO &lt;= 17.800</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.052</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M625.389,-222.907C642.298,-213.016 660.5,-202.368 677.788,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"679.869,-195.091 686.734,-187.021 676.335,-189.049 679.869,-195.091\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M561.5,-68C561.5,-68 490.5,-68 490.5,-68 484.5,-68 478.5,-62 478.5,-56 478.5,-56 478.5,-12 478.5,-12 478.5,-6 484.5,-0 490.5,-0 490.5,-0 561.5,-0 561.5,-0 567.5,-0 573.5,-6 573.5,-12 573.5,-12 573.5,-56 573.5,-56 573.5,-62 567.5,-68 561.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"526\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"526\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=56</text>\r\n",
       "<text text-anchor=\"middle\" x=\"526\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 39/17</text>\r\n",
       "<text text-anchor=\"middle\" x=\"526\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.340</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M544.829,-103.726C542.53,-95.3351 540.103,-86.4745 537.783,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"541.141,-77.0193 535.123,-68.2996 534.39,-78.869 541.141,-77.0193\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M678.5,-68C678.5,-68 603.5,-68 603.5,-68 597.5,-68 591.5,-62 591.5,-56 591.5,-56 591.5,-12 591.5,-12 591.5,-6 597.5,-0 603.5,-0 603.5,-0 678.5,-0 678.5,-0 684.5,-0 690.5,-6 690.5,-12 690.5,-12 690.5,-56 690.5,-56 690.5,-62 684.5,-68 678.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"641\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"641\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"641\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"641\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.535</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M587.651,-103.726C594.589,-94.7878 601.941,-85.3168 608.897,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"611.784,-78.3451 615.151,-68.2996 606.254,-74.0528 611.784,-78.3451\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M791.5,-68C791.5,-68 720.5,-68 720.5,-68 714.5,-68 708.5,-62 708.5,-56 708.5,-56 708.5,-12 708.5,-12 708.5,-6 714.5,-0 720.5,-0 720.5,-0 791.5,-0 791.5,-0 797.5,-0 803.5,-6 803.5,-12 803.5,-12 803.5,-56 803.5,-56 803.5,-62 797.5,-68 791.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=18</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 18/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"756\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.590</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M756,-103.726C756,-95.5175 756,-86.8595 756,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"759.5,-78.2996 756,-68.2996 752.5,-78.2996 759.5,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M904.5,-68C904.5,-68 833.5,-68 833.5,-68 827.5,-68 821.5,-62 821.5,-56 821.5,-56 821.5,-12 821.5,-12 821.5,-6 827.5,-0 833.5,-0 833.5,-0 904.5,-0 904.5,-0 910.5,-0 916.5,-6 916.5,-12 916.5,-12 916.5,-56 916.5,-56 916.5,-62 910.5,-68 904.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"869\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"869\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"869\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 8/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"869\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.791</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M798.077,-103.726C807.678,-94.423 817.874,-84.5428 827.452,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"829.89,-77.7721 834.636,-68.2996 825.019,-72.7451 829.89,-77.7721\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b3b610>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"567pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 566.50 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 562.5,-429 562.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M357.5,-425C357.5,-425 238.5,-425 238.5,-425 232.5,-425 226.5,-419 226.5,-413 226.5,-413 226.5,-354 226.5,-354 226.5,-348 232.5,-342 238.5,-342 238.5,-342 357.5,-342 357.5,-342 363.5,-342 369.5,-348 369.5,-354 369.5,-354 369.5,-413 369.5,-413 369.5,-419 363.5,-425 357.5,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"298\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"298\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.620</text>\r\n",
       "<text text-anchor=\"middle\" x=\"298\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"298\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"298\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 84.885</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M277.5,-306C277.5,-306 158.5,-306 158.5,-306 152.5,-306 146.5,-300 146.5,-294 146.5,-294 146.5,-235 146.5,-235 146.5,-229 152.5,-223 158.5,-223 158.5,-223 277.5,-223 277.5,-223 283.5,-223 289.5,-229 289.5,-235 289.5,-235 289.5,-294 289.5,-294 289.5,-300 283.5,-306 277.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"218\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"218\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 17.590</text>\r\n",
       "<text text-anchor=\"middle\" x=\"218\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"218\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"218\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 22.031</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M270.244,-341.907C264.163,-333.014 257.664,-323.509 251.389,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"254.24,-312.3 245.707,-306.021 248.462,-316.251 254.24,-312.3\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M438.5,-306C438.5,-306 319.5,-306 319.5,-306 313.5,-306 307.5,-300 307.5,-294 307.5,-294 307.5,-235 307.5,-235 307.5,-229 313.5,-223 319.5,-223 319.5,-223 438.5,-223 438.5,-223 444.5,-223 450.5,-229 450.5,-235 450.5,-235 450.5,-294 450.5,-294 450.5,-300 444.5,-306 438.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"379\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"379\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 7.416</text>\r\n",
       "<text text-anchor=\"middle\" x=\"379\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"379\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"379\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 31.817</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M326.103,-341.907C332.26,-333.014 338.84,-323.509 345.194,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"348.133,-316.235 350.947,-306.021 342.377,-312.251 348.133,-316.235\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M144.5,-187C144.5,-187 25.5,-187 25.5,-187 19.5,-187 13.5,-181 13.5,-175 13.5,-175 13.5,-116 13.5,-116 13.5,-110 19.5,-104 25.5,-104 25.5,-104 144.5,-104 144.5,-104 150.5,-104 156.5,-110 156.5,-116 156.5,-116 156.5,-175 156.5,-175 156.5,-181 150.5,-187 144.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"85\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"85\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 11.120</text>\r\n",
       "<text text-anchor=\"middle\" x=\"85\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"85\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 227</text>\r\n",
       "<text text-anchor=\"middle\" x=\"85\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.867</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M171.856,-222.907C161.128,-213.469 149.616,-203.343 138.597,-193.649\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"140.882,-190.998 131.062,-187.021 136.259,-196.254 140.882,-190.998\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M261.5,-179.5C261.5,-179.5 186.5,-179.5 186.5,-179.5 180.5,-179.5 174.5,-173.5 174.5,-167.5 174.5,-167.5 174.5,-123.5 174.5,-123.5 174.5,-117.5 180.5,-111.5 186.5,-111.5 186.5,-111.5 261.5,-111.5 261.5,-111.5 267.5,-111.5 273.5,-117.5 273.5,-123.5 273.5,-123.5 273.5,-167.5 273.5,-167.5 273.5,-173.5 267.5,-179.5 261.5,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"224\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"224\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"224\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"224\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.068</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M220.082,-222.907C220.631,-212.204 221.225,-200.615 221.781,-189.776\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"225.282,-189.833 222.299,-179.667 218.291,-189.475 225.282,-189.833\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.279</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M72.712,-103.726C70.1832,-95.3351 67.5129,-86.4745 64.9611,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"68.2722,-76.8643 62.0355,-68.2996 61.5699,-78.8842 68.2722,-76.8643\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M214,-68C214,-68 134,-68 134,-68 128,-68 122,-62 122,-56 122,-56 122,-12 122,-12 122,-6 128,-0 134,-0 134,-0 214,-0 214,-0 220,-0 226,-6 226,-12 226,-12 226,-56 226,-56 226,-62 220,-68 214,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=114</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 3/111</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.604</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M118.14,-103.726C125.479,-94.6966 133.26,-85.1235 140.609,-76.0816\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"143.343,-78.2672 146.935,-68.2996 137.911,-73.8521 143.343,-78.2672\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M433.5,-187C433.5,-187 314.5,-187 314.5,-187 308.5,-187 302.5,-181 302.5,-175 302.5,-175 302.5,-116 302.5,-116 302.5,-110 308.5,-104 314.5,-104 314.5,-104 433.5,-104 433.5,-104 439.5,-104 445.5,-110 445.5,-116 445.5,-116 445.5,-175 445.5,-175 445.5,-181 439.5,-187 433.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"374\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"374\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 9.640</text>\r\n",
       "<text text-anchor=\"middle\" x=\"374\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"374\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"374\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 11.325</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M377.265,-222.907C376.908,-214.558 376.529,-205.671 376.159,-197.02\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"379.656,-196.862 375.732,-187.021 372.662,-197.161 379.656,-196.862\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M546.5,-179.5C546.5,-179.5 475.5,-179.5 475.5,-179.5 469.5,-179.5 463.5,-173.5 463.5,-167.5 463.5,-167.5 463.5,-123.5 463.5,-123.5 463.5,-117.5 469.5,-111.5 475.5,-111.5 475.5,-111.5 546.5,-111.5 546.5,-111.5 552.5,-111.5 558.5,-117.5 558.5,-123.5 558.5,-123.5 558.5,-167.5 558.5,-167.5 558.5,-173.5 552.5,-179.5 546.5,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"511\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 26/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.382</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M424.797,-222.907C438.117,-211.101 452.653,-198.217 465.929,-186.45\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"468.419,-188.919 473.581,-179.667 463.776,-183.681 468.419,-188.919\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M368.5,-68C368.5,-68 297.5,-68 297.5,-68 291.5,-68 285.5,-62 285.5,-56 285.5,-56 285.5,-12 285.5,-12 285.5,-6 291.5,-0 297.5,-0 297.5,-0 368.5,-0 368.5,-0 374.5,-0 380.5,-6 380.5,-12 380.5,-12 380.5,-56 380.5,-56 380.5,-62 374.5,-68 368.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"333\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"333\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=56</text>\r\n",
       "<text text-anchor=\"middle\" x=\"333\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 39/17</text>\r\n",
       "<text text-anchor=\"middle\" x=\"333\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.340</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M358.733,-103.726C355.557,-95.2439 352.201,-86.2819 349,-77.7312\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"352.253,-76.4373 345.468,-68.2996 345.697,-78.892 352.253,-76.4373\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M485.5,-68C485.5,-68 410.5,-68 410.5,-68 404.5,-68 398.5,-62 398.5,-56 398.5,-56 398.5,-12 398.5,-12 398.5,-6 404.5,-0 410.5,-0 410.5,-0 485.5,-0 485.5,-0 491.5,-0 497.5,-6 497.5,-12 497.5,-12 497.5,-56 497.5,-56 497.5,-62 491.5,-68 485.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"448\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"448\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"448\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"448\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.535</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M401.555,-103.726C407.534,-94.879 413.865,-85.51 419.866,-76.6303\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"422.797,-78.5448 425.496,-68.2996 416.997,-74.6253 422.797,-78.5448\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c08f8fd0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>PRICE</th>\n",
       "      <th>$f_1$</th>\n",
       "      <th>$r_1$</th>\n",
       "      <th>$\\gamma_2$</th>\n",
       "      <th>$f_2$</th>\n",
       "      <th>$r_2$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.790943</td>\n",
       "      <td>0.446476</td>\n",
       "      <td>0.344467</td>\n",
       "      <td>-0.278861</td>\n",
       "      <td>0.362818</td>\n",
       "      <td>0.428125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.166827</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.481136</td>\n",
       "      <td>-0.604298</td>\n",
       "      <td>0.133020</td>\n",
       "      <td>-0.299847</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.319199</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.633508</td>\n",
       "      <td>-0.604298</td>\n",
       "      <td>0.133020</td>\n",
       "      <td>-0.452219</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.471572</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.785881</td>\n",
       "      <td>-0.278861</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.702222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2.989460</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>2.313243</td>\n",
       "      <td>0.340383</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>2.211128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>-0.438920</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.753229</td>\n",
       "      <td>-0.278861</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.669571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>-0.057989</td>\n",
       "      <td>0.314309</td>\n",
       "      <td>-0.372298</td>\n",
       "      <td>-0.278861</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.288640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>0.595036</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>-0.081182</td>\n",
       "      <td>0.340383</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>-0.183297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>0.867129</td>\n",
       "      <td>0.676217</td>\n",
       "      <td>0.190912</td>\n",
       "      <td>0.340383</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>0.088797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>0.540617</td>\n",
       "      <td>0.049439</td>\n",
       "      <td>0.491178</td>\n",
       "      <td>-0.534712</td>\n",
       "      <td>-0.110974</td>\n",
       "      <td>0.651591</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>404 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        PRICE     $f_1$     $r_1$ $\\gamma_2$     $f_2$     $r_2$\n",
       "0    0.790943  0.446476  0.344467  -0.278861  0.362818  0.428125\n",
       "1   -0.166827  0.314309 -0.481136  -0.604298  0.133020 -0.299847\n",
       "2   -0.319199  0.314309 -0.633508  -0.604298  0.133020 -0.452219\n",
       "3   -0.471572  0.314309 -0.785881  -0.278861  0.230651 -0.702222\n",
       "4    2.989460  0.676217  2.313243   0.340383  0.778332  2.211128\n",
       "..        ...       ...       ...        ...       ...       ...\n",
       "399 -0.438920  0.314309 -0.753229  -0.278861  0.230651 -0.669571\n",
       "400 -0.057989  0.314309 -0.372298  -0.278861  0.230651 -0.288640\n",
       "401  0.595036  0.676217 -0.081182   0.340383  0.778332 -0.183297\n",
       "402  0.867129  0.676217  0.190912   0.340383  0.778332  0.088797\n",
       "403  0.540617  0.049439  0.491178  -0.534712 -0.110974  0.651591\n",
       "\n",
       "[404 rows x 6 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In iteration 1, we firstly train a tree using residuals_1. This tree tells us height is also important in determining weight. Whose who are less than 1.55 meters are supported to lose -7.289 and the other to gain 7.289. Again, we want to shrink this to 20%, which is -1.4578 and 1.4578. We then make prediction_2 based on prediction_1 and $\\gamma$. We see Alex gains 1.4578 kg because he is 1.6. Others also gain or lose weight because of the new rule."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"920pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 920.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 916,-429 916,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M506,-425C506,-425 387,-425 387,-425 381,-425 375,-419 375,-413 375,-413 375,-354 375,-354 375,-348 381,-342 387,-342 387,-342 506,-342 506,-342 512,-342 518,-348 518,-354 518,-354 518,-413 518,-413 518,-419 512,-425 506,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"446.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"446.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"446.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"446.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"446.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.249</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M420,-306C420,-306 301,-306 301,-306 295,-306 289,-300 289,-294 289,-294 289,-235 289,-235 289,-229 295,-223 301,-223 301,-223 420,-223 420,-223 426,-223 432,-229 432,-235 432,-235 432,-294 432,-294 432,-300 426,-306 420,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 4.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 19.198</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M416.663,-341.907C410.126,-333.014 403.139,-323.509 396.393,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"399.027,-312.005 390.285,-306.021 393.387,-316.151 399.027,-312.005\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M592,-306C592,-306 473,-306 473,-306 467,-306 461,-300 461,-294 461,-294 461,-235 461,-235 461,-229 467,-223 473,-223 473,-223 592,-223 592,-223 598,-223 604,-229 604,-235 604,-235 604,-294 604,-294 604,-300 598,-306 592,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 18.055</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 13.338</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M476.337,-341.907C482.874,-333.014 489.861,-323.509 496.607,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"499.613,-316.151 502.715,-306.021 493.973,-312.005 499.613,-316.151\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M220,-187C220,-187 101,-187 101,-187 95,-187 89,-181 89,-175 89,-175 89,-116 89,-116 89,-110 95,-104 101,-104 101,-104 220,-104 220,-104 226,-104 232,-110 232,-116 232,-116 232,-175 232,-175 232,-181 226,-187 220,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">NOX &lt;= 0.500</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 7.488</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M291.111,-222.907C274.202,-213.016 256,-202.368 238.712,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"240.165,-189.049 229.766,-187.021 236.631,-195.091 240.165,-189.049\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M423,-187C423,-187 298,-187 298,-187 292,-187 286,-181 286,-175 286,-175 286,-116 286,-116 286,-110 292,-104 298,-104 298,-104 423,-104 423,-104 429,-104 435,-110 435,-116 435,-116 435,-175 435,-175 435,-181 429,-187 423,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">PTRATIO &lt;= 18.000</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"360.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.109</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M360.5,-222.907C360.5,-214.649 360.5,-205.864 360.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"364,-197.021 360.5,-187.021 357,-197.021 364,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 31/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.519</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M118.423,-103.726C108.822,-94.423 98.6263,-84.5428 89.048,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"91.4811,-72.7451 81.864,-68.2996 86.6098,-77.7721 91.4811,-72.7451\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M196,-68C196,-68 125,-68 125,-68 119,-68 113,-62 113,-56 113,-56 113,-12 113,-12 113,-6 119,-0 125,-0 125,-0 196,-0 196,-0 202,-0 208,-6 208,-12 208,-12 208,-56 208,-56 208,-62 202,-68 196,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 13/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.407</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M160.5,-103.726C160.5,-95.5175 160.5,-86.8595 160.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"164,-78.2996 160.5,-68.2996 157,-78.2996 164,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M309,-68C309,-68 238,-68 238,-68 232,-68 226,-62 226,-56 226,-56 226,-12 226,-12 226,-6 232,-0 238,-0 238,-0 309,-0 309,-0 315,-0 321,-6 321,-12 321,-12 321,-56 321,-56 321,-62 315,-68 309,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 10/15</text>\r\n",
       "<text text-anchor=\"middle\" x=\"273.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.057</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M328.104,-103.726C321.003,-94.7878 313.478,-85.3168 306.358,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"308.918,-73.9519 299.957,-68.2996 303.438,-78.3065 308.918,-73.9519\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M426,-68C426,-68 351,-68 351,-68 345,-68 339,-62 339,-56 339,-56 339,-12 339,-12 339,-6 345,-0 351,-0 351,-0 426,-0 426,-0 432,-0 438,-6 438,-12 438,-12 438,-56 438,-56 438,-62 432,-68 426,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"388.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"388.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=26</text>\r\n",
       "<text text-anchor=\"middle\" x=\"388.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/24</text>\r\n",
       "<text text-anchor=\"middle\" x=\"388.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.234</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M370.926,-103.726C373.072,-95.3351 375.338,-86.4745 377.503,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"380.898,-78.855 379.985,-68.2996 374.117,-77.1208 380.898,-78.855\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M592,-187C592,-187 473,-187 473,-187 467,-187 461,-181 461,-175 461,-175 461,-116 461,-116 461,-110 467,-104 473,-104 473,-104 592,-104 592,-104 598,-104 604,-110 604,-116 604,-116 604,-175 604,-175 604,-181 598,-187 592,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">TAX &lt;= 280.000</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 227</text>\r\n",
       "<text text-anchor=\"middle\" x=\"532.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.988</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M532.5,-222.907C532.5,-214.649 532.5,-205.864 532.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"536,-197.021 532.5,-187.021 529,-197.021 536,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M805,-187C805,-187 686,-187 686,-187 680,-187 674,-181 674,-175 674,-175 674,-116 674,-116 674,-110 680,-104 686,-104 686,-104 805,-104 805,-104 811,-104 817,-110 817,-116 817,-116 817,-175 817,-175 817,-181 811,-187 805,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">NOX &lt;= 0.671</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.649</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M604.018,-224.215C623.6,-213.459 644.957,-201.728 665.004,-190.716\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"666.728,-193.762 673.808,-185.88 663.358,-187.627 666.728,-193.762\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M543,-68C543,-68 468,-68 468,-68 462,-68 456,-62 456,-56 456,-56 456,-12 456,-12 456,-6 462,-0 468,-0 468,-0 543,-0 543,-0 549,-0 555,-6 555,-12 555,-12 555,-56 555,-56 555,-62 549,-68 543,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"505.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"505.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"505.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 19/38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"505.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.050</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M522.446,-103.726C520.4,-95.4263 518.24,-86.6671 516.173,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"519.503,-77.1709 513.711,-68.2996 512.707,-78.8467 519.503,-77.1709\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M665.5,-68C665.5,-68 585.5,-68 585.5,-68 579.5,-68 573.5,-62 573.5,-56 573.5,-56 573.5,-12 573.5,-12 573.5,-6 579.5,-0 585.5,-0 585.5,-0 665.5,-0 665.5,-0 671.5,-0 677.5,-6 677.5,-12 677.5,-12 677.5,-56 677.5,-56 677.5,-62 671.5,-68 665.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"625.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"625.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=170</text>\r\n",
       "<text text-anchor=\"middle\" x=\"625.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 16/154</text>\r\n",
       "<text text-anchor=\"middle\" x=\"625.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.393</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M567.13,-103.726C574.799,-94.6966 582.929,-85.1235 590.609,-76.0816\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"593.412,-78.1873 597.218,-68.2996 588.077,-73.6559 593.412,-78.1873\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M783,-68C783,-68 708,-68 708,-68 702,-68 696,-62 696,-56 696,-56 696,-12 696,-12 696,-6 702,-0 708,-0 708,-0 783,-0 783,-0 789,-0 795,-6 795,-12 795,-12 795,-56 795,-56 795,-62 789,-68 783,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/35</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.515</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M745.5,-103.726C745.5,-95.5175 745.5,-86.8595 745.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"749,-78.2996 745.5,-68.2996 742,-78.2996 749,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M900,-68C900,-68 825,-68 825,-68 819,-68 813,-62 813,-56 813,-56 813,-12 813,-12 813,-6 819,-0 825,-0 825,-0 900,-0 900,-0 906,-0 912,-6 912,-12 912,-12 912,-56 912,-56 912,-62 906,-68 900,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=39</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/39</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.035</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M789.066,-103.726C799.007,-94.423 809.564,-84.5428 819.481,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"822.01,-77.6882 826.92,-68.2996 817.227,-72.5774 822.01,-77.6882\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c08f8460>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"560pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 560.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 556,-429 556,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M371,-425C371,-425 252,-425 252,-425 246,-425 240,-419 240,-413 240,-413 240,-354 240,-354 240,-348 246,-342 252,-342 252,-342 371,-342 371,-342 377,-342 383,-348 383,-354 383,-354 383,-413 383,-413 383,-419 377,-425 371,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"311.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 6.907</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.249</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M291,-306C291,-306 172,-306 172,-306 166,-306 160,-300 160,-294 160,-294 160,-235 160,-235 160,-229 166,-223 172,-223 172,-223 291,-223 291,-223 297,-223 303,-229 303,-235 303,-235 303,-294 303,-294 303,-300 297,-306 291,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"231.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"231.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 4.980</text>\r\n",
       "<text text-anchor=\"middle\" x=\"231.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"231.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"231.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 19.198</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M283.744,-341.907C277.663,-333.014 271.164,-323.509 264.889,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"267.74,-312.3 259.207,-306.021 261.962,-316.251 267.74,-312.3\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M452,-306C452,-306 333,-306 333,-306 327,-306 321,-300 321,-294 321,-294 321,-235 321,-235 321,-229 327,-223 333,-223 333,-223 452,-223 452,-223 458,-223 464,-229 464,-235 464,-235 464,-294 464,-294 464,-300 458,-306 452,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 18.055</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 13.338</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M339.603,-341.907C345.76,-333.014 352.34,-323.509 358.694,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"361.633,-316.235 364.447,-306.021 355.877,-312.251 361.633,-316.235\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M163,-187C163,-187 44,-187 44,-187 38,-187 32,-181 32,-175 32,-175 32,-116 32,-116 32,-110 38,-104 44,-104 44,-104 163,-104 163,-104 169,-104 175,-110 175,-116 175,-116 175,-175 175,-175 175,-181 169,-187 163,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"103.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"103.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">NOX &lt;= 0.500</text>\r\n",
       "<text text-anchor=\"middle\" x=\"103.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"103.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"103.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 7.488</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M187.091,-222.907C176.865,-213.56 165.9,-203.538 155.388,-193.929\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"157.573,-191.184 147.83,-187.021 152.85,-196.351 157.573,-191.184\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M280,-179.5C280,-179.5 205,-179.5 205,-179.5 199,-179.5 193,-173.5 193,-167.5 193,-167.5 193,-123.5 193,-123.5 193,-117.5 199,-111.5 205,-111.5 205,-111.5 280,-111.5 280,-111.5 286,-111.5 292,-117.5 292,-123.5 292,-123.5 292,-167.5 292,-167.5 292,-173.5 286,-179.5 280,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"242.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"242.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"242.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/39</text>\r\n",
       "<text text-anchor=\"middle\" x=\"242.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.093</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M235.316,-222.907C236.323,-212.204 237.412,-200.615 238.431,-189.776\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"241.93,-189.951 239.382,-179.667 234.961,-189.295 241.93,-189.951\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 31/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.519</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M82.6477,-103.726C78.263,-95.1527 73.6277,-86.0891 69.2124,-77.4555\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"72.1994,-75.6092 64.5299,-68.2996 65.9671,-78.7965 72.1994,-75.6092\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M196,-68C196,-68 125,-68 125,-68 119,-68 113,-62 113,-56 113,-56 113,-12 113,-12 113,-6 119,-0 125,-0 125,-0 196,-0 196,-0 202,-0 208,-6 208,-12 208,-12 208,-56 208,-56 208,-62 202,-68 196,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 13/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"160.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.407</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M124.725,-103.726C129.235,-95.0615 134.006,-85.8962 138.543,-77.1802\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"141.653,-78.7859 143.166,-68.2996 135.444,-75.5537 141.653,-78.7859\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M422.5,-179.5C422.5,-179.5 342.5,-179.5 342.5,-179.5 336.5,-179.5 330.5,-173.5 330.5,-167.5 330.5,-167.5 330.5,-123.5 330.5,-123.5 330.5,-117.5 336.5,-111.5 342.5,-111.5 342.5,-111.5 422.5,-111.5 422.5,-111.5 428.5,-111.5 434.5,-117.5 434.5,-123.5 434.5,-123.5 434.5,-167.5 434.5,-167.5 434.5,-173.5 428.5,-179.5 422.5,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"382.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"382.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=227</text>\r\n",
       "<text text-anchor=\"middle\" x=\"382.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 35/192</text>\r\n",
       "<text text-anchor=\"middle\" x=\"382.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.307</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M389.031,-222.907C388.116,-212.204 387.125,-200.615 386.199,-189.776\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"389.674,-189.333 385.335,-179.667 382.699,-189.929 389.674,-189.333\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M540,-179.5C540,-179.5 465,-179.5 465,-179.5 459,-179.5 453,-173.5 453,-167.5 453,-167.5 453,-123.5 453,-123.5 453,-117.5 459,-111.5 465,-111.5 465,-111.5 540,-111.5 540,-111.5 546,-111.5 552,-117.5 552,-123.5 552,-123.5 552,-167.5 552,-167.5 552,-173.5 546,-179.5 540,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"502.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"502.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"502.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/74</text>\r\n",
       "<text text-anchor=\"middle\" x=\"502.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.792</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M430.664,-222.907C441.557,-211.321 453.425,-198.698 464.319,-187.111\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"467.018,-189.35 471.317,-179.667 461.918,-184.555 467.018,-189.35\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b30220>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>PRICE</th>\n",
       "      <th>$f_2$</th>\n",
       "      <th>$r_2$</th>\n",
       "      <th>$\\gamma_3$</th>\n",
       "      <th>$f_3$</th>\n",
       "      <th>$r_3$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.790943</td>\n",
       "      <td>0.362818</td>\n",
       "      <td>0.428125</td>\n",
       "      <td>0.518987</td>\n",
       "      <td>0.518514</td>\n",
       "      <td>0.272429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.166827</td>\n",
       "      <td>0.133020</td>\n",
       "      <td>-0.299847</td>\n",
       "      <td>-0.307329</td>\n",
       "      <td>0.040821</td>\n",
       "      <td>-0.207648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.319199</td>\n",
       "      <td>0.133020</td>\n",
       "      <td>-0.452219</td>\n",
       "      <td>-0.307329</td>\n",
       "      <td>0.040821</td>\n",
       "      <td>-0.360020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.471572</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.702222</td>\n",
       "      <td>-0.307329</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.610024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2.989460</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>2.211128</td>\n",
       "      <td>1.407326</td>\n",
       "      <td>1.200530</td>\n",
       "      <td>1.788930</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>-0.438920</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.669571</td>\n",
       "      <td>-0.307329</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.577372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>-0.057989</td>\n",
       "      <td>0.230651</td>\n",
       "      <td>-0.288640</td>\n",
       "      <td>-0.307329</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.196441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>0.595036</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>-0.183297</td>\n",
       "      <td>-0.093024</td>\n",
       "      <td>0.750425</td>\n",
       "      <td>-0.155390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>0.867129</td>\n",
       "      <td>0.778332</td>\n",
       "      <td>0.088797</td>\n",
       "      <td>0.518987</td>\n",
       "      <td>0.934028</td>\n",
       "      <td>-0.066899</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>0.540617</td>\n",
       "      <td>-0.110974</td>\n",
       "      <td>0.651591</td>\n",
       "      <td>-0.792032</td>\n",
       "      <td>-0.348584</td>\n",
       "      <td>0.889201</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>404 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        PRICE     $f_2$     $r_2$ $\\gamma_3$     $f_3$     $r_3$\n",
       "0    0.790943  0.362818  0.428125   0.518987  0.518514  0.272429\n",
       "1   -0.166827  0.133020 -0.299847  -0.307329  0.040821 -0.207648\n",
       "2   -0.319199  0.133020 -0.452219  -0.307329  0.040821 -0.360020\n",
       "3   -0.471572  0.230651 -0.702222  -0.307329  0.138452 -0.610024\n",
       "4    2.989460  0.778332  2.211128   1.407326  1.200530  1.788930\n",
       "..        ...       ...       ...        ...       ...       ...\n",
       "399 -0.438920  0.230651 -0.669571  -0.307329  0.138452 -0.577372\n",
       "400 -0.057989  0.230651 -0.288640  -0.307329  0.138452 -0.196441\n",
       "401  0.595036  0.778332 -0.183297  -0.093024  0.750425 -0.155390\n",
       "402  0.867129  0.778332  0.088797   0.518987  0.934028 -0.066899\n",
       "403  0.540617 -0.110974  0.651591  -0.792032 -0.348584  0.889201\n",
       "\n",
       "[404 rows x 6 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Iteration 2 again tells us that gender matters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"914pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 914.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 910,-429 910,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M517,-425C517,-425 398,-425 398,-425 392,-425 386,-419 386,-413 386,-413 386,-354 386,-354 386,-348 392,-342 398,-342 398,-342 517,-342 517,-342 523,-342 529,-348 529,-354 529,-354 529,-413 529,-413 529,-419 523,-425 517,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"457.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"457.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.620</text>\r\n",
       "<text text-anchor=\"middle\" x=\"457.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"457.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"457.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 25.696</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M432,-306C432,-306 307,-306 307,-306 301,-306 295,-300 295,-294 295,-294 295,-235 295,-235 295,-229 301,-223 307,-223 307,-223 432,-223 432,-223 438,-223 444,-229 444,-235 444,-235 444,-294 444,-294 444,-300 438,-306 432,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">PTRATIO &lt;= 20.200</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.813</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M426.969,-341.907C420.211,-332.923 412.985,-323.315 406.016,-314.05\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"408.785,-311.909 399.977,-306.021 403.191,-316.116 408.785,-311.909\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M605,-306C605,-306 486,-306 486,-306 480,-306 474,-300 474,-294 474,-294 474,-235 474,-235 474,-229 480,-223 486,-223 486,-223 605,-223 605,-223 611,-223 617,-229 617,-235 617,-235 617,-294 617,-294 617,-300 611,-306 605,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.998</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 12.928</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M488.031,-341.907C494.789,-332.923 502.015,-323.315 508.984,-314.05\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"511.809,-316.116 515.023,-306.021 506.215,-311.909 511.809,-316.116\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M226,-187C226,-187 107,-187 107,-187 101,-187 95,-181 95,-175 95,-175 95,-116 95,-116 95,-110 101,-104 107,-104 107,-104 226,-104 226,-104 232,-104 238,-110 238,-116 238,-116 238,-175 238,-175 238,-181 232,-187 226,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">TAX &lt;= 304.000</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 170</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.340</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M299.07,-222.907C281.907,-213.016 263.433,-202.368 245.885,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"247.217,-188.982 236.805,-187.021 243.722,-195.047 247.217,-188.982\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M429,-187C429,-187 310,-187 310,-187 304,-187 298,-181 298,-175 298,-175 298,-116 298,-116 298,-110 304,-104 310,-104 310,-104 429,-104 429,-104 435,-104 441,-110 441,-116 441,-116 441,-175 441,-175 441,-181 435,-187 429,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 16.350</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 133</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.027</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M369.5,-222.907C369.5,-214.649 369.5,-205.864 369.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"373,-197.021 369.5,-187.021 366,-197.021 373,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=81</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 23/58</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.063</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M122.934,-103.726C112.993,-94.423 102.436,-84.5428 92.5188,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"94.7733,-72.5774 85.0804,-68.2996 89.99,-77.6882 94.7733,-72.5774\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M204,-68C204,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 204,-0 204,-0 210,-0 216,-6 216,-12 216,-12 216,-56 216,-56 216,-62 210,-68 204,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=89</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/77</text>\r\n",
       "<text text-anchor=\"middle\" x=\"166.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.298</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M166.5,-103.726C166.5,-95.5175 166.5,-86.8595 166.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"170,-78.2996 166.5,-68.2996 163,-78.2996 170,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M321,-68C321,-68 246,-68 246,-68 240,-68 234,-62 234,-56 234,-56 234,-12 234,-12 234,-6 240,-0 246,-0 246,-0 321,-0 321,-0 327,-0 333,-6 333,-12 333,-12 333,-56 333,-56 333,-62 327,-68 321,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=66</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 8/58</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.286</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M337.477,-103.726C330.457,-94.7878 323.018,-85.3168 315.98,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"318.582,-74.0022 309.653,-68.2996 313.077,-78.3259 318.582,-74.0022\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M438,-68C438,-68 363,-68 363,-68 357,-68 351,-62 351,-56 351,-56 351,-12 351,-12 351,-6 357,-0 363,-0 363,-0 438,-0 438,-0 444,-0 450,-6 450,-12 450,-12 450,-56 450,-56 450,-62 444,-68 438,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"400.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"400.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=67</text>\r\n",
       "<text text-anchor=\"middle\" x=\"400.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 4/63</text>\r\n",
       "<text text-anchor=\"middle\" x=\"400.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.640</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M381.043,-103.726C383.419,-95.3351 385.927,-86.4745 388.324,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"391.716,-78.8749 391.073,-68.2996 384.981,-76.968 391.716,-78.8749\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M605,-187C605,-187 486,-187 486,-187 480,-187 474,-181 474,-175 474,-175 474,-116 474,-116 474,-110 480,-104 486,-104 486,-104 605,-104 605,-104 611,-104 617,-110 617,-116 617,-116 617,-175 617,-175 617,-181 611,-187 605,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 11.285</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"545.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.689</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M545.5,-222.907C545.5,-214.649 545.5,-205.864 545.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"549,-197.021 545.5,-187.021 542,-197.021 549,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M805,-187C805,-187 686,-187 686,-187 680,-187 674,-181 674,-175 674,-175 674,-116 674,-116 674,-110 680,-104 686,-104 686,-104 805,-104 805,-104 811,-104 817,-110 817,-116 817,-116 817,-175 817,-175 817,-181 811,-187 805,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">DIS &lt;= 2.721</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.486</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M614.889,-222.907C631.798,-213.016 650,-202.368 667.288,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"669.369,-195.091 676.234,-187.021 665.835,-189.049 669.369,-195.091\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M551,-68C551,-68 480,-68 480,-68 474,-68 468,-62 468,-56 468,-56 468,-12 468,-12 468,-6 474,-0 480,-0 480,-0 551,-0 551,-0 557,-0 563,-6 563,-12 563,-12 563,-56 563,-56 563,-62 557,-68 551,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"515.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"515.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=37</text>\r\n",
       "<text text-anchor=\"middle\" x=\"515.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 19/18</text>\r\n",
       "<text text-anchor=\"middle\" x=\"515.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.047</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M534.329,-103.726C532.03,-95.3351 529.603,-86.4745 527.283,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"530.641,-77.0193 524.623,-68.2996 523.89,-78.869 530.641,-77.0193\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M668,-68C668,-68 593,-68 593,-68 587,-68 581,-62 581,-56 581,-56 581,-12 581,-12 581,-6 587,-0 593,-0 593,-0 668,-0 668,-0 674,-0 680,-6 680,-12 680,-12 680,-56 680,-56 680,-62 674,-68 668,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"630.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"630.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"630.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"630.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.466</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M577.151,-103.726C584.089,-94.7878 591.441,-85.3168 598.397,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"601.284,-78.3451 604.651,-68.2996 595.754,-74.0528 601.284,-78.3451\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M781,-68C781,-68 710,-68 710,-68 704,-68 698,-62 698,-56 698,-56 698,-12 698,-12 698,-6 704,-0 710,-0 710,-0 781,-0 781,-0 787,-0 793,-6 793,-12 793,-12 793,-56 793,-56 793,-62 787,-68 781,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.919</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M745.5,-103.726C745.5,-95.5175 745.5,-86.8595 745.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"749,-78.2996 745.5,-68.2996 742,-78.2996 749,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M894,-68C894,-68 823,-68 823,-68 817,-68 811,-62 811,-56 811,-56 811,-12 811,-12 811,-6 817,-0 823,-0 823,-0 894,-0 894,-0 900,-0 906,-6 906,-12 906,-12 906,-56 906,-56 906,-62 900,-68 894,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"858.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"858.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"858.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 29/9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"858.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.494</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M787.577,-103.726C797.178,-94.423 807.374,-84.5428 816.952,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"819.39,-77.7721 824.136,-68.2996 814.519,-72.7451 819.39,-77.7721\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2be419280>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"487pt\" height=\"314pt\"\r\n",
       " viewBox=\"0.00 0.00 486.50 314.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 310)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-310 482.5,-310 482.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M304.5,-306C304.5,-306 185.5,-306 185.5,-306 179.5,-306 173.5,-300 173.5,-294 173.5,-294 173.5,-235 173.5,-235 173.5,-229 179.5,-223 185.5,-223 185.5,-223 304.5,-223 304.5,-223 310.5,-223 316.5,-229 316.5,-235 316.5,-235 316.5,-294 316.5,-294 316.5,-300 310.5,-306 304.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"245\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"245\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.620</text>\r\n",
       "<text text-anchor=\"middle\" x=\"245\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"245\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"245\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 25.696</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M225.5,-187C225.5,-187 100.5,-187 100.5,-187 94.5,-187 88.5,-181 88.5,-175 88.5,-175 88.5,-116 88.5,-116 88.5,-110 94.5,-104 100.5,-104 100.5,-104 225.5,-104 225.5,-104 231.5,-104 237.5,-110 237.5,-116 237.5,-116 237.5,-175 237.5,-175 237.5,-181 231.5,-187 225.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"163\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"163\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">PTRATIO &lt;= 20.200</text>\r\n",
       "<text text-anchor=\"middle\" x=\"163\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"163\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"163\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.813</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M216.551,-222.907C210.317,-214.014 203.656,-204.509 197.223,-195.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"200.005,-193.201 191.399,-187.021 194.272,-197.219 200.005,-193.201\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M386.5,-187C386.5,-187 267.5,-187 267.5,-187 261.5,-187 255.5,-181 255.5,-175 255.5,-175 255.5,-116 255.5,-116 255.5,-110 261.5,-104 267.5,-104 267.5,-104 386.5,-104 386.5,-104 392.5,-104 398.5,-110 398.5,-116 398.5,-116 398.5,-175 398.5,-175 398.5,-181 392.5,-187 386.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"327\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"327\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.998</text>\r\n",
       "<text text-anchor=\"middle\" x=\"327\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"327\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"327\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 12.928</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M273.449,-222.907C279.683,-214.014 286.344,-204.509 292.777,-195.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"295.728,-197.219 298.601,-187.021 289.995,-193.201 295.728,-197.219\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=170</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 35/135</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.187</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M121.668,-103.726C112.329,-94.5142 102.418,-84.7364 93.0896,-75.5343\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"95.3328,-72.8308 85.7558,-68.2996 90.4168,-77.8141 95.3328,-72.8308\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M214,-68C214,-68 134,-68 134,-68 128,-68 122,-62 122,-56 122,-56 122,-12 122,-12 122,-6 128,-0 134,-0 134,-0 214,-0 214,-0 220,-0 226,-6 226,-12 226,-12 226,-56 226,-56 226,-62 220,-68 214,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=133</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/121</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.468</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M167.096,-103.726C167.93,-95.4263 168.81,-86.6671 169.652,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"173.138,-78.5994 170.655,-68.2996 166.173,-77.8997 173.138,-78.5994\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M353.5,-68C353.5,-68 278.5,-68 278.5,-68 272.5,-68 266.5,-62 266.5,-56 266.5,-56 266.5,-12 266.5,-12 266.5,-6 272.5,-0 278.5,-0 278.5,-0 353.5,-0 353.5,-0 359.5,-0 365.5,-6 365.5,-12 365.5,-12 365.5,-56 365.5,-56 365.5,-62 359.5,-68 353.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"316\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"316\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"316\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 21/29</text>\r\n",
       "<text text-anchor=\"middle\" x=\"316\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.093</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M322.904,-103.726C322.07,-95.4263 321.19,-86.6671 320.348,-78.2834\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"323.827,-77.8997 319.345,-68.2996 316.862,-78.5994 323.827,-77.8997\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M466.5,-68C466.5,-68 395.5,-68 395.5,-68 389.5,-68 383.5,-62 383.5,-56 383.5,-56 383.5,-12 383.5,-12 383.5,-6 389.5,-0 395.5,-0 395.5,-0 466.5,-0 466.5,-0 472.5,-0 478.5,-6 478.5,-12 478.5,-12 478.5,-56 478.5,-56 478.5,-62 472.5,-68 466.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"431\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"431\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"431\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 41/10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"431\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.618</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M365.726,-103.726C374.388,-94.6054 383.578,-84.93 392.242,-75.8078\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"395.024,-77.9608 399.373,-68.2996 389.949,-73.1401 395.024,-77.9608\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b2d5b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>PRICE</th>\n",
       "      <th>$f_3$</th>\n",
       "      <th>$r_3$</th>\n",
       "      <th>$\\gamma_4$</th>\n",
       "      <th>$f_4$</th>\n",
       "      <th>$r_4$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.790943</td>\n",
       "      <td>0.518514</td>\n",
       "      <td>0.272429</td>\n",
       "      <td>-0.187350</td>\n",
       "      <td>0.462309</td>\n",
       "      <td>0.328634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.166827</td>\n",
       "      <td>0.040821</td>\n",
       "      <td>-0.207648</td>\n",
       "      <td>-0.187350</td>\n",
       "      <td>-0.015384</td>\n",
       "      <td>-0.151443</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.319199</td>\n",
       "      <td>0.040821</td>\n",
       "      <td>-0.360020</td>\n",
       "      <td>-0.467809</td>\n",
       "      <td>-0.099522</td>\n",
       "      <td>-0.219677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.471572</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.610024</td>\n",
       "      <td>-0.467809</td>\n",
       "      <td>-0.001891</td>\n",
       "      <td>-0.469681</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2.989460</td>\n",
       "      <td>1.200530</td>\n",
       "      <td>1.788930</td>\n",
       "      <td>-0.092576</td>\n",
       "      <td>1.172757</td>\n",
       "      <td>1.816703</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>-0.438920</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.577372</td>\n",
       "      <td>-0.467809</td>\n",
       "      <td>-0.001891</td>\n",
       "      <td>-0.437029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>-0.057989</td>\n",
       "      <td>0.138452</td>\n",
       "      <td>-0.196441</td>\n",
       "      <td>-0.187350</td>\n",
       "      <td>0.082247</td>\n",
       "      <td>-0.140236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>0.595036</td>\n",
       "      <td>0.750425</td>\n",
       "      <td>-0.155390</td>\n",
       "      <td>-0.092576</td>\n",
       "      <td>0.722652</td>\n",
       "      <td>-0.127617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>0.867129</td>\n",
       "      <td>0.934028</td>\n",
       "      <td>-0.066899</td>\n",
       "      <td>-0.092576</td>\n",
       "      <td>0.906255</td>\n",
       "      <td>-0.039126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>0.540617</td>\n",
       "      <td>-0.348584</td>\n",
       "      <td>0.889201</td>\n",
       "      <td>-0.092576</td>\n",
       "      <td>-0.376357</td>\n",
       "      <td>0.916974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>404 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        PRICE     $f_3$     $r_3$ $\\gamma_4$     $f_4$     $r_4$\n",
       "0    0.790943  0.518514  0.272429  -0.187350  0.462309  0.328634\n",
       "1   -0.166827  0.040821 -0.207648  -0.187350 -0.015384 -0.151443\n",
       "2   -0.319199  0.040821 -0.360020  -0.467809 -0.099522 -0.219677\n",
       "3   -0.471572  0.138452 -0.610024  -0.467809 -0.001891 -0.469681\n",
       "4    2.989460  1.200530  1.788930  -0.092576  1.172757  1.816703\n",
       "..        ...       ...       ...        ...       ...       ...\n",
       "399 -0.438920  0.138452 -0.577372  -0.467809 -0.001891 -0.437029\n",
       "400 -0.057989  0.138452 -0.196441  -0.187350  0.082247 -0.140236\n",
       "401  0.595036  0.750425 -0.155390  -0.092576  0.722652 -0.127617\n",
       "402  0.867129  0.934028 -0.066899  -0.092576  0.906255 -0.039126\n",
       "403  0.540617 -0.348584  0.889201  -0.092576 -0.376357  0.916974\n",
       "\n",
       "[404 rows x 6 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Iteration 3 argues that height is important, too."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"920pt\" height=\"433pt\"\r\n",
       " viewBox=\"0.00 0.00 920.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-429 916,-429 916,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M513,-425C513,-425 394,-425 394,-425 388,-425 382,-419 382,-413 382,-413 382,-354 382,-354 382,-348 388,-342 394,-342 394,-342 513,-342 513,-342 519,-342 525,-348 525,-354 525,-354 525,-413 525,-413 525,-419 519,-425 513,-425\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"453.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"453.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 11.310</text>\r\n",
       "<text text-anchor=\"middle\" x=\"453.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"453.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"453.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.859</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M427,-306C427,-306 308,-306 308,-306 302,-306 296,-300 296,-294 296,-294 296,-235 296,-235 296,-229 302,-223 308,-223 308,-223 427,-223 427,-223 433,-223 439,-229 439,-235 439,-235 439,-294 439,-294 439,-300 433,-306 427,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.979</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 202</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 9.321</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M423.663,-341.907C417.126,-333.014 410.139,-323.509 403.393,-314.331\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"406.027,-312.005 397.285,-306.021 400.387,-316.151 406.027,-312.005\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M600,-306C600,-306 481,-306 481,-306 475,-306 469,-300 469,-294 469,-294 469,-235 469,-235 469,-229 475,-223 481,-223 481,-223 600,-223 600,-223 606,-223 612,-229 612,-235 612,-235 612,-294 612,-294 612,-300 606,-306 600,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">NOX &lt;= 0.601</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 202</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.945</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M483.684,-341.907C490.365,-332.923 497.509,-323.315 504.399,-314.05\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"507.211,-316.134 510.369,-306.021 501.593,-311.957 507.211,-316.134\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M225,-187C225,-187 106,-187 106,-187 100,-187 94,-181 94,-175 94,-175 94,-116 94,-116 94,-110 100,-104 106,-104 106,-104 225,-104 225,-104 231,-104 237,-110 237,-116 237,-116 237,-175 237,-175 237,-181 231,-187 225,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">DIS &lt;= 3.396</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.744</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M297.417,-222.907C280.339,-213.016 261.955,-202.368 244.494,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"245.867,-189.004 235.459,-187.021 242.358,-195.062 245.867,-189.004\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M427,-187C427,-187 308,-187 308,-187 302,-187 296,-181 296,-175 296,-175 296,-116 296,-116 296,-110 302,-104 308,-104 308,-104 427,-104 427,-104 433,-104 439,-110 439,-116 439,-116 439,-175 439,-175 439,-181 433,-187 427,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">DIS &lt;= 2.862</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"367.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.990</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M367.5,-222.907C367.5,-214.649 367.5,-205.864 367.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"371,-197.021 367.5,-187.021 364,-197.021 371,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 18/20</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.191</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M121.561,-103.726C111.536,-94.423 100.889,-84.5428 90.8864,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"93.0954,-72.5362 83.3845,-68.2996 88.3339,-77.6673 93.0954,-72.5362\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M205.5,-68C205.5,-68 125.5,-68 125.5,-68 119.5,-68 113.5,-62 113.5,-56 113.5,-56 113.5,-12 113.5,-12 113.5,-6 119.5,-0 125.5,-0 125.5,-0 205.5,-0 205.5,-0 211.5,-0 217.5,-6 217.5,-12 217.5,-12 217.5,-56 217.5,-56 217.5,-62 211.5,-68 205.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=113</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/81</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.116</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M165.5,-103.726C165.5,-95.5175 165.5,-86.8595 165.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"169,-78.2996 165.5,-68.2996 162,-78.2996 169,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M319,-68C319,-68 248,-68 248,-68 242,-68 236,-62 236,-56 236,-56 236,-12 236,-12 236,-6 242,-0 248,-0 248,-0 319,-0 319,-0 325,-0 331,-6 331,-12 331,-12 331,-56 331,-56 331,-62 325,-68 319,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 13/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.854</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M336.222,-103.726C329.365,-94.7878 322.099,-85.3168 315.225,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"317.909,-74.1036 309.045,-68.2996 312.355,-78.3643 317.909,-74.1036\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M432,-68C432,-68 361,-68 361,-68 355,-68 349,-62 349,-56 349,-56 349,-12 349,-12 349,-6 355,-0 361,-0 361,-0 432,-0 432,-0 438,-0 444,-6 444,-12 444,-12 444,-56 444,-56 444,-62 438,-68 432,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"396.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"396.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=38</text>\r\n",
       "<text text-anchor=\"middle\" x=\"396.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 28/10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"396.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.297</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M378.299,-103.726C380.521,-95.3351 382.867,-86.4745 385.11,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"388.504,-78.8624 387.681,-68.2996 381.737,-77.0703 388.504,-78.8624\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M600,-187C600,-187 481,-187 481,-187 475,-187 469,-181 469,-175 469,-175 469,-116 469,-116 469,-110 475,-104 481,-104 481,-104 600,-104 600,-104 606,-104 612,-110 612,-116 612,-116 612,-175 612,-175 612,-181 606,-187 600,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">TAX &lt;= 287.000</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"540.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.888</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M540.5,-222.907C540.5,-214.649 540.5,-205.864 540.5,-197.302\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"544,-197.021 540.5,-187.021 537,-197.021 544,-197.021\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M805,-187C805,-187 686,-187 686,-187 680,-187 674,-181 674,-175 674,-175 674,-116 674,-116 674,-110 680,-104 686,-104 686,-104 805,-104 805,-104 811,-104 817,-110 817,-116 817,-116 817,-175 817,-175 817,-181 811,-187 805,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 14.700</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.945</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M611.624,-222.907C628.956,-213.016 647.612,-202.368 665.333,-192.254\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"667.552,-195.017 674.502,-187.021 664.082,-188.938 667.552,-195.017\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M549,-68C549,-68 474,-68 474,-68 468,-68 462,-62 462,-56 462,-56 462,-12 462,-12 462,-6 468,-0 474,-0 474,-0 549,-0 549,-0 555,-0 561,-6 561,-12 561,-12 561,-56 561,-56 561,-62 555,-68 549,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"511.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 12/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"511.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.013</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M529.701,-103.726C527.479,-95.3351 525.133,-86.4745 522.89,-78.0072\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"526.263,-77.0703 520.319,-68.2996 519.496,-78.8624 526.263,-77.0703\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M666,-68C666,-68 591,-68 591,-68 585,-68 579,-62 579,-56 579,-56 579,-12 579,-12 579,-6 585,-0 591,-0 591,-0 666,-0 666,-0 672,-0 678,-6 678,-12 678,-12 678,-56 678,-56 678,-62 672,-68 666,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 16/60</text>\r\n",
       "<text text-anchor=\"middle\" x=\"628.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.231</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M573.268,-103.726C580.451,-94.7878 588.063,-85.3168 595.264,-76.3558\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"598.203,-78.2869 601.739,-68.2996 592.746,-73.9019 598.203,-78.2869\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M783,-68C783,-68 708,-68 708,-68 702,-68 696,-62 696,-56 696,-56 696,-12 696,-12 696,-6 702,-0 708,-0 708,-0 783,-0 783,-0 789,-0 795,-6 795,-12 795,-12 795,-56 795,-56 795,-62 789,-68 783,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=25</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 11/14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"745.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.109</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M745.5,-103.726C745.5,-95.5175 745.5,-86.8595 745.5,-78.56\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"749,-78.2996 745.5,-68.2996 742,-78.2996 749,-78.2996\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M900,-68C900,-68 825,-68 825,-68 819,-68 813,-62 813,-56 813,-56 813,-12 813,-12 813,-6 819,-0 825,-0 825,-0 900,-0 900,-0 906,-0 912,-6 912,-12 912,-12 912,-56 912,-56 912,-62 906,-68 900,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=76</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 4/72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.572</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M789.066,-103.726C799.007,-94.423 809.564,-84.5428 819.481,-75.2612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"822.01,-77.6882 826.92,-68.2996 817.227,-72.5774 822.01,-77.6882\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2c0b2dd60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"313pt\" height=\"314pt\"\r\n",
       " viewBox=\"0.00 0.00 313.00 314.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 310)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-310 309,-310 309,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M241.5,-306C241.5,-306 122.5,-306 122.5,-306 116.5,-306 110.5,-300 110.5,-294 110.5,-294 110.5,-235 110.5,-235 110.5,-229 116.5,-223 122.5,-223 122.5,-223 241.5,-223 241.5,-223 247.5,-223 253.5,-229 253.5,-235 253.5,-235 253.5,-294 253.5,-294 253.5,-300 247.5,-306 241.5,-306\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"182\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"182\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">LSTAT &lt;= 11.310</text>\r\n",
       "<text text-anchor=\"middle\" x=\"182\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"182\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 404</text>\r\n",
       "<text text-anchor=\"middle\" x=\"182\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.859</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M170.5,-187C170.5,-187 51.5,-187 51.5,-187 45.5,-187 39.5,-181 39.5,-175 39.5,-175 39.5,-116 39.5,-116 39.5,-110 45.5,-104 51.5,-104 51.5,-104 170.5,-104 170.5,-104 176.5,-104 182.5,-110 182.5,-116 182.5,-116 182.5,-175 182.5,-175 182.5,-181 176.5,-187 170.5,-187\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">RM &lt;= 6.979</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">split_quantile = 0.75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 202</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 9.321</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M157.367,-222.907C152.025,-214.105 146.32,-204.703 140.803,-195.612\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"143.77,-193.754 135.59,-187.021 137.785,-197.386 143.77,-193.754\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M293,-179.5C293,-179.5 213,-179.5 213,-179.5 207,-179.5 201,-173.5 201,-167.5 201,-167.5 201,-123.5 201,-123.5 201,-117.5 207,-111.5 213,-111.5 213,-111.5 293,-111.5 293,-111.5 299,-111.5 305,-117.5 305,-123.5 305,-123.5 305,-167.5 305,-167.5 305,-173.5 299,-179.5 293,-179.5\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"253\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"253\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=202</text>\r\n",
       "<text text-anchor=\"middle\" x=\"253\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 43/159</text>\r\n",
       "<text text-anchor=\"middle\" x=\"253\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.320</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M206.633,-222.907C213.396,-211.763 220.742,-199.658 227.55,-188.439\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"230.677,-190.032 232.873,-179.667 224.693,-186.4 230.677,-190.032\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=151</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 50/101</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.038</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M89.0306,-103.726C84.3619,-95.0615 79.4235,-85.8962 74.7272,-77.1802\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"77.7669,-75.4428 69.9422,-68.2996 71.6045,-78.7632 77.7669,-75.4428\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M205.5,-68C205.5,-68 134.5,-68 134.5,-68 128.5,-68 122.5,-62 122.5,-56 122.5,-56 122.5,-12 122.5,-12 122.5,-6 128.5,-0 134.5,-0 134.5,-0 205.5,-0 205.5,-0 211.5,-0 217.5,-6 217.5,-12 217.5,-12 217.5,-56 217.5,-56 217.5,-62 211.5,-68 205.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=51</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 41/10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.453</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M132.969,-103.726C137.638,-95.0615 142.576,-85.8962 147.273,-77.1802\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"150.396,-78.7632 152.058,-68.2996 144.233,-75.4428 150.396,-78.7632\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2c2bfd6d0d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>PRICE</th>\n",
       "      <th>$f_4$</th>\n",
       "      <th>$r_4$</th>\n",
       "      <th>$\\gamma_5$</th>\n",
       "      <th>$f_5$</th>\n",
       "      <th>$r_5$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.790943</td>\n",
       "      <td>0.462309</td>\n",
       "      <td>0.328634</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>0.450970</td>\n",
       "      <td>0.339973</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.166827</td>\n",
       "      <td>-0.015384</td>\n",
       "      <td>-0.151443</td>\n",
       "      <td>-0.320003</td>\n",
       "      <td>-0.111385</td>\n",
       "      <td>-0.055442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.319199</td>\n",
       "      <td>-0.099522</td>\n",
       "      <td>-0.219677</td>\n",
       "      <td>-0.320003</td>\n",
       "      <td>-0.195523</td>\n",
       "      <td>-0.123677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.471572</td>\n",
       "      <td>-0.001891</td>\n",
       "      <td>-0.469681</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>-0.013230</td>\n",
       "      <td>-0.458342</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2.989460</td>\n",
       "      <td>1.172757</td>\n",
       "      <td>1.816703</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>1.161419</td>\n",
       "      <td>1.828041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>-0.438920</td>\n",
       "      <td>-0.001891</td>\n",
       "      <td>-0.437029</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>-0.013230</td>\n",
       "      <td>-0.425691</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>-0.057989</td>\n",
       "      <td>0.082247</td>\n",
       "      <td>-0.140236</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>0.070908</td>\n",
       "      <td>-0.128898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>0.595036</td>\n",
       "      <td>0.722652</td>\n",
       "      <td>-0.127617</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>0.711314</td>\n",
       "      <td>-0.116278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>0.867129</td>\n",
       "      <td>0.906255</td>\n",
       "      <td>-0.039126</td>\n",
       "      <td>-0.037795</td>\n",
       "      <td>0.894917</td>\n",
       "      <td>-0.027787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>0.540617</td>\n",
       "      <td>-0.376357</td>\n",
       "      <td>0.916974</td>\n",
       "      <td>-0.320003</td>\n",
       "      <td>-0.472358</td>\n",
       "      <td>1.012975</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>404 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        PRICE     $f_4$     $r_4$ $\\gamma_5$     $f_5$     $r_5$\n",
       "0    0.790943  0.462309  0.328634  -0.037795  0.450970  0.339973\n",
       "1   -0.166827 -0.015384 -0.151443  -0.320003 -0.111385 -0.055442\n",
       "2   -0.319199 -0.099522 -0.219677  -0.320003 -0.195523 -0.123677\n",
       "3   -0.471572 -0.001891 -0.469681  -0.037795 -0.013230 -0.458342\n",
       "4    2.989460  1.172757  1.816703  -0.037795  1.161419  1.828041\n",
       "..        ...       ...       ...        ...       ...       ...\n",
       "399 -0.438920 -0.001891 -0.437029  -0.037795 -0.013230 -0.425691\n",
       "400 -0.057989  0.082247 -0.140236  -0.037795  0.070908 -0.128898\n",
       "401  0.595036  0.722652 -0.127617  -0.037795  0.711314 -0.116278\n",
       "402  0.867129  0.906255 -0.039126  -0.037795  0.894917 -0.027787\n",
       "403  0.540617 -0.376357  0.916974  -0.320003 -0.472358  1.012975\n",
       "\n",
       "[404 rows x 6 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's stop at Iteration 4. And take a look at the loss."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(loss[1:])\n",
    "plt.title('loss of XBR')\n",
    "plt.xlabel('iteratoin')\n",
    "plt.ylabel('loss')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
